0

I want to detect if android app is launched for 1st time and its behavior be different than from when user presses "clear data" button for app.

I have seen solutions based on shared preference but those solutions do not distinguish from situation when user clears data as it will remove shared preference -> Determine if android app is the first time used

v.j
  • 186
  • 11

1 Answers1

0

You should not be doing this, its not wise to save data even user delete your app or clears the data. It just forcing your app to save data. Optimal way of doing this is to

  1. Use a back-end service which will save your data to your server.
  2. Retrieve it whenever user opens your app.

or use Firebase Database for your purpose, it is very easy to implement an it is optimal as doesn't require you to write back-end services, you can handle back-end and front-end on your own.

Here check this link it will help:

https://firebase.google.com/docs/database/android/start/

Hope it helps

Rahul Singh Chandrabhan
  • 2,531
  • 5
  • 22
  • 33