0

Is it possible to create an apk & set an expiry date in it , application will be automatically deleted from mobile device when that date comes. Don't want device to be rooted for this.Want the solution should work both for rooted & Unrooted device.Is it possible to do so?

Arnav Goel
  • 21
  • 1
  • 3
  • You can simply check the current date. If it's past the expiration date, finish the app (after showing a message). – Phantômaxx Mar 18 '14 at 16:55
  • I want the app to be uninstalled from device not only finish it.Is it possible that app gets automatically uninstalled on specific date? – Arnav Goel Mar 18 '14 at 16:58
  • It's not possible. You have to ask user permissions AND the device HAS TO be rooted. – Phantômaxx Mar 18 '14 at 17:02
  • Thanks Vyger for the reply.Is it possible i send some notification at that specific date , when the user click on that option i take the user to page in settings that give the user option to uninstall the app Or when user click on that notification i display a pop up that gives the option of uninstalling the app? – Arnav Goel Mar 18 '14 at 17:06
  • Yes, it is. See this [answer](http://stackoverflow.com/questions/19517417/opening-android-settings-programmatically) – Phantômaxx Mar 18 '14 at 17:09
  • Thanks Vyger , appreciate you help. – Arnav Goel Mar 18 '14 at 17:12
  • For the notification part that's another question - you have to set an alarm on a specific date (with WakeLock, to survive reboots) and set a Notification and/or open the system settings page through a click on it. – Phantômaxx Mar 18 '14 at 17:14

1 Answers1

0

I don't think this is possible without a custom system, because you would need to do the following things:

  • Edit Android's Application Installer to look in the application's manifest for something like expirationDate and compare it with current date.
  • If the expiration date is not reached yet, you would start a new Handler thread to check the date every hour or every day, what you want.
  • If the expiration date is reached then, the application would be automatically uninstalled.

And to install a custom system, you MUST root your device.

Axel
  • 568
  • 7
  • 18