How to make a permanent signup account in android

129 Views Asked by At

I am making an app and I used sqlite as database. But whenever I uninstall and reinstall my app, previous accounts which I have made before uninstalling the app doesn't exists.

I want to make it the way that if user creates account on it and then uninstall that app, then whenever he/she will reinstall it, his /her previous signup account should be existing.

Is there any way to do so ? Please share. Thanks!

3

There are 3 best solutions below

0
On BEST ANSWER

I suggest to use API call and SharedPreference for storing a particular user account on his device IMEI Number.

Whenever user opens an app

First Check whether the user account is exit in local, If not then check by using API call based on device IMEI number, And even if server don't have the info about the provided IMEI number then allow to login into APP.

This will solve your problem permanently.

3
On

When you uninstall your app, the entire data directory of the app is deleted. This includes databases, preferences, other files, caches etc. In your case there are two possible ways to suits your requirement.

1) After the installation check with your backend / service whether this device having any account created previously in the system and get the login done and store again to your SQlite database or Shared Preferences. Here you need to use the unique identifier (IMEI Number / UDID ) for the device as source to check it. First Check whether the user account is exit in local, If not then check by using API call based on device unique identifier

2) Create the SQlite database in SDcard rather creating the default one. You could try saving the database to the SD Card instead and reading from there Like this . However, you will now lose access to the database if the user changes the SD Card or mounts it to the computer pre honeycomb.

Another option would be to back it up to a server at regular intervals and restore the backup from there manually, or implement something like the Google BackupAgent, which will automatically backup data if the user configures his/her device to backup against the Google account to which it is registered.

If you're worried about your data being read by others, encrypt it using AES or some other encryption technique.

0
On

When you uninstall an application from device all of the app data get deleted from android device. So it is not possible to fulfill your requirement.

If you not uninstall app means use shared preference for next auto sign up.Its will for your requirement.