-1

I'm in the middle of designing an Android App containing a login and registration for users. I took care of the actual login and registration process by linking to a MySQL database through an http / https connection and php files.

I'm looking to add an extra security step by using something like Security Questions (questions only user would know answer to) if the user credentials are entered from a different device than that used to register, or if user decides to change password. Is there any way to check for device ID so I can implement Security Questions?

InigoMontoyaJr
  • 159
  • 4
  • 11
  • 1
    Possible duplicate of [Is there a unique Android device ID?](https://stackoverflow.com/questions/2785485/is-there-a-unique-android-device-id) –  Mar 20 '19 at 22:55

1 Answers1

0

You can use the ANDROID_ID from Settings.Secure class, which is a pretty unique String containing a 64-bit hexadecimal number.

API Level >= 26 (Android 8.0)

64-bit number (expressed as a hexadecimal string), unique to each combination of app-signing key, user, and device.

It may change if a factory reset is performed on the device or if an APK signing key changes.

API Level < 26

64-bit number (expressed as a hexadecimal string) that is randomly generated when the user first sets up the device and should remain constant for the lifetime of the user's device.

On devices that have multiple users, each user appears as a completely separate device, so the ANDROID_ID value is unique to each user.