1

I just want uninstall my applciation after a specific time. This is to make the application available for a specific time frame.

How can I do it.

Thanks

Rajeev
  • 91
  • 1
  • 2
  • 8
  • What do you want to do this . ie control a device from remote location and limit the user not to use my apps. – Vipin Sahu Feb 26 '13 at 10:42

2 Answers2

6

That is not possible and I quote:

Uninstalling without user confirmation is not allowed to 3rd party applications.

As xDragonZ points out, a root process can crudely do this by literally removing the directory and leaving the package manager to deal with the loss, but that's not a very widely deployable solution, since AFAIK no devices ship with that capability for apps to run their own root helper process - that's a risky aftermarket modification.

Quoted from SO Delete my application programmatically

For further reading install / uninstall APKs programmatically (PackageManager vs Intents)

Community
  • 1
  • 1
Ahmad Kayyali
  • 8,233
  • 13
  • 49
  • 83
0

Some systems, like Apphance use simple service to limit the app in some way. Apps with Apphance installed try to connect to the Apphance server to check if the particular app is allowed to run. If not, the user is notified and shortly after that the app is closed by Apphance. It's impossible to start the app without connection.

I would suggest storing a timestamp of the first launch and then limit the app by comparing the two dates and killing the app in case its trial was finished. Using some kind of server is the safest solution.

Zielony
  • 16,239
  • 6
  • 34
  • 39