Perfect unique_id for device except IMEI,Android_ID,WLAN Mac and Bluetooth address

Durai Amuthan.H

Objective:

I am looking for a way to find out a unique_id for android device.

Background:

I will use the Id in login request payload and as my app is license based service app the Id should not change under normal circumstances.

Existing Approaches:

In iOS there are some unique id solutions for iOS such as CFUUID or identifierForVendor coupled with Keychain,Advertising Identifier etc.. that can do this job upto the expectation.

But in Android all the options that I know seems to have hole in it.

IMEI:

TelephonyManager TelephonyMgr = (TelephonyManager)getSystemService(TELEPHONY_SERVICE); 
String m_deviceId = TelephonyMgr.getDeviceId();

Drawbacks

It is sim card dependent so

  • If there is no sim card then we're doomed

  • If there is dual sim then we're dommed

Android_ID:

  String m_androidId = Secure.getString(getContentResolver(), Secure.ANDROID_ID);

Drawbacks

  • If OS version is upgraded then it may change
  • If device is rooted it gets changed
  • No guarantee that the device_id is unique there are some reports some manufacturers are having duplicate device_id

The WLAN MAC Address

WifiManager m_wm = (WifiManager)getSystemService(Context.WIFI_SERVICE); 
String m_wlanMacAdd = m_wm.getConnectionInfo().getMacAddress();

Drawbacks

  • If there is no wifi hardware then we're doomed
  • In some new devices If wifi is off then we're doomed.

Bluetooth Address:

   BluetoothAdapter m_BluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); 
   String m_bluetoothAdd = m_BluetoothAdapter.getAddress();

Drawbacks:

  • if there is no bluetooth hardware we're doomed.
  • In future in some new devices we mightn't able to read it if its off.

Possible solutions:

There are two approaches that I think to solve this problem

  • We generate a random id by hashing timestamp with unique ids that I have mentioned and store it so next time during login we’ll check if the the stored value of key is null if its so then we’ll generate and store it else we’ll use the value of the key.

    If there is something equivalent to keychain of iOS then we’re good with this approach.

  • Find a global identifier something like advertisingIdentifier of iOS which is same for all the apps in the device.

Any help is appreciated !

Durai Amuthan.H

I have chosen to use Android_ID since It's not dependent on any hardware.

Build.SERIAL also dependent on availability of telephony that is in wifi only devices this Build.SERIAL won't work.

I have explained how other approaches are dependent upon the hardware availability in the question itself.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

Get the MAC address of bluetooth adapter in Android

From Dev

How to get Bluetooth MAC Address on Android

From Dev

Get the MAC address of bluetooth adapter in Android

From Dev

android 6.0 not returning the exact bluetooth mac address

From Dev

Reasons not to assume device MAC address is unique

From Dev

Can you get the Bluetooth MAC Address of a Bluetooth Device when you have its name?

From Dev

Get MAC address of device

From Dev

get mac address of device

From Dev

Get MAC address of device

From Dev

Not able to pass Bluetooth Device address to create a socket in android

From Dev

Android 5 static bluetooth MAC address for BLE advertising

From Dev

Android Bluetooth connection using createInsecureRfcommSocketToServiceRecord without MAC address

From Dev

Is it possible to get bluetooth mac address in android jar library?

From Dev

Difference between Mac Address and Bluetooth Address

From Dev

Gettind a device MAC address by IP

From Dev

What is the value in '$_SERVER['UNIQUE_ID'] used for?

From Dev

How to select radio with similar unique_id

From Java

Is there a unique Android device ID?

From Dev

Pinging a bluetooth device in Android

From Dev

Android Bluetooth device UUID

From Dev

Unauthorised Bluetooth device keeps connecting to Mac

From Dev

Get Bluetooth local mac address in Marshmallow

From Dev

c# Bluetooth Mac Address of our Adapter

From Dev

Get mac address of detected bluetooth devices

From Dev

Extract Bluetooth MAC Address: hcitool dev

From Dev

How to know the Bluetooth MAC address in Alpine Linux

From Dev

iptables - Redirect except list MAC Address

From Dev

Is there a unique identifier for a Bluetooth device accessible to iOS and Android without connecting?

From Dev

Bluetooth in Android: how to access my Bluetooth address?

Related Related

  1. 1

    Get the MAC address of bluetooth adapter in Android

  2. 2

    How to get Bluetooth MAC Address on Android

  3. 3

    Get the MAC address of bluetooth adapter in Android

  4. 4

    android 6.0 not returning the exact bluetooth mac address

  5. 5

    Reasons not to assume device MAC address is unique

  6. 6

    Can you get the Bluetooth MAC Address of a Bluetooth Device when you have its name?

  7. 7

    Get MAC address of device

  8. 8

    get mac address of device

  9. 9

    Get MAC address of device

  10. 10

    Not able to pass Bluetooth Device address to create a socket in android

  11. 11

    Android 5 static bluetooth MAC address for BLE advertising

  12. 12

    Android Bluetooth connection using createInsecureRfcommSocketToServiceRecord without MAC address

  13. 13

    Is it possible to get bluetooth mac address in android jar library?

  14. 14

    Difference between Mac Address and Bluetooth Address

  15. 15

    Gettind a device MAC address by IP

  16. 16

    What is the value in '$_SERVER['UNIQUE_ID'] used for?

  17. 17

    How to select radio with similar unique_id

  18. 18

    Is there a unique Android device ID?

  19. 19

    Pinging a bluetooth device in Android

  20. 20

    Android Bluetooth device UUID

  21. 21

    Unauthorised Bluetooth device keeps connecting to Mac

  22. 22

    Get Bluetooth local mac address in Marshmallow

  23. 23

    c# Bluetooth Mac Address of our Adapter

  24. 24

    Get mac address of detected bluetooth devices

  25. 25

    Extract Bluetooth MAC Address: hcitool dev

  26. 26

    How to know the Bluetooth MAC address in Alpine Linux

  27. 27

    iptables - Redirect except list MAC Address

  28. 28

    Is there a unique identifier for a Bluetooth device accessible to iOS and Android without connecting?

  29. 29

    Bluetooth in Android: how to access my Bluetooth address?

HotTag

Archive