i'm working on an android app that will occasionally do some rest calls, i need a way to identify each user when doing those calls. I don't want them to register an account, so i'm thinking to use their primary email, and register that when the app is launched for the first time but the problem is that they may change their primary email at any time and that will lead to a new registration and the user will lose all data associated with the old email. Not sure if OAuth will work here, haven't worked with it before but as far as i understand, OAuth only works with google API's. So now im looking for alternatives. Thank you.
Asked
Active
Viewed 47 times
0
-
Do you care if they lose their data when they do a factory reset? – nasch Jul 24 '16 at 22:40
-
You don't want to integrate with Social logins? Facebook/google/twitter etc? – gaara87 Jul 28 '16 at 17:59
-
at the moment we don't plan to do that – alex Jul 31 '16 at 04:15
1 Answers
0
With the caveats that it will change on a factory reset, and there will be multiple IDs if the device has multiple profiles, you can use Settings.Secure.ANDROID_ID
. Other options are mentioned here:
Is there a unique Android device ID?
ANDROID_ID
won't work for emulators, and there are a few devices that don't provide a unique ID, however they're old enough at this point that it's probably not a major issue.