0

I would like to make an album and add some music files when my android app is first installed on a device. Is there a way is can do something like below?

public void onInstall(){
    setup();
}
Alden
  • 272
  • 4
  • 12

3 Answers3

0

You can't do anything after the app is installed, only after it is run.

Just store a flag in your SharedPreferences to see whether or not it has done its first-time install process already and then perform it, or, if you're installing music files, check for their existence and install them if they're not there yet.

EboMike
  • 72,990
  • 14
  • 152
  • 157
0

There's no way to know when your app is installed... however, you can detect when it's first launched. It has been discussed a lot of times here. You just need to persist it using a shared preference.

Cristian
  • 191,931
  • 60
  • 351
  • 260
0

here comes the answer ;-)

Get referrer after installing app from Android Market

Community
  • 1
  • 1
sherif
  • 2,274
  • 16
  • 21