4

I would like to execute some code on installation in order to register with an API. This would happen without user interaction other than purchase>download>install from the market. While I can (and do) trigger this on first run, I've seen testers who, after reinstalling their OS, just re-download their apps and forget to open for the first time. As my apps primary use is as a service when someone calls, they are normally not too likely to open the app for long periods of time.

My preference would be to create a notification on installation reminding them they need to open the app.

I have looked at using DBOpenHelper onCreate or onUpgrade but these seem to fire when the database is requested (i.e. after a user interaction)

The install/remove/upgrade intents aren't any good either as they don't register in the app being installed.

I guess I'm looking to see if there is a way to do this or if it's been locked down completely, so I'm happy to accept answers citing documentation/research showing it's not possible.

Ben Neill
  • 2,811
  • 2
  • 22
  • 20

1 Answers1

2

This kind of thing has been covered before. Summary: no, there is no reliable way.

Community
  • 1
  • 1
kabuko
  • 36,028
  • 10
  • 80
  • 93
  • Thanks for the link, that at least gives me something for < 3.1 which is 90% of users at this point. As for the comment on my testers, following procedure when they aren't actually testing isn't really a valid, or helpful comment. – Ben Neill Mar 03 '12 at 05:03
  • Sorry, maybe that was too snarky, but testing is all about reliably reproducing results. Proper environment setup is a big part of that... – kabuko Mar 03 '12 at 05:11
  • No worries, most of them love my app so it tends to stay installed after testing... which then creates another handy test environment - the average user. While I would expect them to open my app, all bets are off when the general public are involved! – Ben Neill Mar 03 '12 at 05:19