0

I can understand an Android app not having permissions to delete anything else on the phone, but can an app delete it's own data and then itself through Package manager.

I'm thinking of having an app delete itself once a time period expires. Would Google play automatically re-push the app to the phone after it detects the app is gone from the phone.

If you programatically uninstall the app, presumably this would be the same as the user choosing to uninstall the app.

Has anyone done this and possibly have some code they could share?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
user1325094
  • 339
  • 5
  • 13

2 Answers2

2

Why would you do it this way? Just code your app so that it doesn't do anything useful after the trigger event, and the user will eventually delete it themselves due to it being useless for them.

That way, you could even pop up a dialog box when they try to start your demo:

+---------------------------------------+
|  This demo has expired, please visit  |
|   dodgybrothers.com for an upgrade.   |
+---------------------------------------+

to try and upsell them. And apologies for the ASCII art, if I was any good at graphic design, I wouldn't be a code monkey :-)

This is basic marketing. You don't want to terminate a relationship with a potential customer. Far better to maintain the relationship and "push" (though not too pushy of course) the benefits of upgrading.

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
  • I have other valid reasons for deleting the app, but I do understand your point of staying connected with the customer. – user1325094 May 15 '12 at 09:46
0

Sorry,

An application cannot delete itself. You could maybe find a workaround on rooted devices, but you cannot assume that all users will have rooted devices.

Distwo
  • 11,569
  • 8
  • 42
  • 65