Is there any event triggered when the application is finished installed in the phone.I have seen some post but no luck ,there were similar question asked but no answer was found. Any help would be appreciated. Thanks in advance.
No you can't, the user has to explicitly start your application.
You can always check for the first time your application is launched.
The easiest way to check if your application has to do the installation tasks or not is to check your SharedPreferences when your main Activity is created. As your app has not run before, you're preferences will be empty:
SharedPreferences prefs = getSharedPreferences(SHARED_PREF_NAME, MODE_PRIVATE);
if (!prefs.contains(FIRST_RUN_KEY)) {
prefs.edit().putBoolean(FIRST_RUN_KEY,false).commit();
// TODO Do stuff that should be done at the first run
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With