question

hszrdev avatar image
hszrdev asked

Preserving Data After Uninstall

I have been looking into preserving user data, should users delete our app, and then decide to reinstall. So I have a couple questions related to this that I'm having trouble finding answers to. We are already storing all data on our server, but want to make sure that there is a safe way to make sure we are getting the data for the correct account. (We can currently do this on other devices by using google play accounts, and users can save their account via facebook login on amazon, but we don't want to enforce people to need a facebook account)

1. Is there a way to preserve any data on device when our app is uninstalled? (e.g. using SharedPreferences)

2. Is there a unique user id available for the current, logged in, user? Or does this require hooking up amazon login?

amazon appstorelogin with amazon
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Levon@Amazon avatar image
Levon@Amazon answered

Hi hszrdev,

The data on the device is preserved only when the app is updated in place (that is, a new version installed on top of an existing version).

1. During uninstall, any local app data is always deleted, regardless of the method you used it to create it (SharedPreferences, SQLite, etc). This is by design in Android.

2. To distinguish between your users by some unique data on Amazon devices (for example, by their email address), you will need to use Login with Amazon. Every user of an Amazon device has an LwA account, and this would probably be the easiest way for you to know who you are saving that data for. See: https://developer.amazon.com/login-with-amazon

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.