Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there on install event in android?

Tags:

java

android

Is there some event/receiver or something for handling first execution after installation or directly after installation? Or Do I need it emulate with preferences?

like image 245
Dmytro Avatar asked Feb 09 '10 08:02

Dmytro


People also ask

How can I see when I installed an app on Android?

Navigate to APPS and select the app u want by long press. And then hit the Info button on top right corner. Thats it , it will show u the modified or installed time.


2 Answers

There is the ACTION_PACKAGE_ADDED Broadcast Intent, but the application being installed doesn't receive this.

So checking if a preference is set is probably the easiest solution.

SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(this); boolean firstRun = p.getBoolean(PREFERENCE_FIRST_RUN, true); p.edit().putBoolean(PREFERENCE_FIRST_RUN, false).commit(); 
like image 130
Dave Webb Avatar answered Sep 20 '22 21:09

Dave Webb


See Get referrer after installing app from Android Market - you can put whatever you want in there. I believe this is how Plan B works - the app that can send back your phone's location after it's stolen, that you install from the website after it's been stolen.

like image 44
Kenton Price Avatar answered Sep 19 '22 21:09

Kenton Price