Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First of all, uninstall app automatically is not good way. Try to disable all features.</p> <p>Generally, you need the following algorithm:</p> <p>1) On starting your app (for example in first activity) get SharedPreferences (<a href="http://developer.android.com/reference/android/content/SharedPreferences.html" rel="nofollow">http://developer.android.com/reference/android/content/SharedPreferences.html</a>) and check key with date of first start (for example "firstStartDate"). Also, reads key "lastStartDate". </p> <p>2) If key "firstStartDate" doesn't exist - it's first start of your app, get current date and write it as value of both keys, than continue normal work of app. </p> <p>3) If key "firstStartDate" exists - get current date and check that your trial is not expired (claculate days count between first start and current date). Also, check that current date is more or equal date in "lastStartDate" (protection from date changing on device). If current date is less than "lastStartDate" - it's date hack and user moved time. In this case you can finish trial (see point 5).</p> <p>4) If trial is not expired - OK, continue normal work and write current date into "lastStartDate". </p> <p>5) If expired - show to user dialog (<a href="http://developer.android.com/guide/topics/ui/dialogs.html" rel="nofollow">http://developer.android.com/guide/topics/ui/dialogs.html</a>) about expired trial with parameter cancellable=false and close activity on clicking dialog button.</p> <p>I think this will much better than just uninstall application.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload