-1

I want to make an app similar to SetupWizard. My app should initialize ONLY ONCE when the phone is turned on for the first time and after that it is never displayed. I got the way to autorun it on every boot as a service but how to make it run only once?

I HAVE RESEARCHED

Naman Arora
  • 123
  • 1
  • 2
  • 9

1 Answers1

1

You can store some value in SharedPreferences. And place a check on the value, if it exists and, then it means the app has already initialized.

SharedPreferences can be cleared by the user(just like web-session). If you want to ensure that your solution works even if user clears his phone, then you can get the device IMEI(example here) and send it to some server, which checks whether this device has already initialized or not?

Community
  • 1
  • 1
  • "SharedPreferences can be cleared by the user(just like web-session)" - I didn't realise that you could do this. Thanks. – Dororo Feb 09 '13 at 14:31