TsimoX TsimoX - 11 months ago 81
Android Question

Android PreInstall detection

My android application will be preinstalled. And I want to keep tracking of preinstalled apps.

For this purpose I need somehow to save a key or a flag (which means that app is preinstalled). I will add this key to each request to my back-end and will analyze it.
I have an issue with that. An issue is about update from Google Play.

The standart workflow is the following:

1) I give to a manufacturer a special version of my application, which saves a key somehow (in Shared Prefs for example).

2) Manufacturer sell device with the app (special, modified).

3) When User get it, there definetly be next version of the app (standart, without special code) in the Google Play, so user perhaps update it without any launching (the worst case).

4) I lost my tracking possibility. (new apk fully removing never launched old one which was special)

To solve it I was listening a system broadcast ON_BOOT_COMPLETE, but its not working properly on Android 3.1+.

Have you any ideas how can I do that?

Answer Source

Can you install an additional .apk that only has a service? Then that service can have the key, etc. and it can listen for when your app starts and send the tracking info. Then it won't matter if your app gets upgraded; the service will still be the same.