Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There are some approach to get unique identifier on android phone.</p> <ol> <li><p>Android ID It is a 64-bit hex string which is generated on the device's first boot. Generally it won't changed unless is factory reset.</p> <p>Secure.getString(getContentResolver(), Secure.ANDROID_ID);</p></li> </ol> <p>The Android ID , considered unreliable because it can sometimes be null. The documentation states that it "can change upon factory reset". This string can also be altered on a rooted phone.</p> <pre><code> String m_szAndroidID = Secure.getString(getContentResolver(), Secure.ANDROID_ID); Returns: 9774d56d682e549c . No special permissions required. </code></pre> <p>2. The WLAN MAC Address string, is another unique identifier that you can use as a device id. Before you read it, you will need to make sure that your project has the android.permission.ACCESS_WIFI_STATE permission or the WLAN MAC Address will come up as null.</p> <pre><code> WifiManager wm = (WifiManager)getSystemService(Context.WIFI_SERVICE); String m_szWLANMAC = wm.getConnectionInfo().getMacAddress(); Returns: 00:11:22:33:44:55 (not a real address since this is a custom ROM , as you can see the MAC address can easily be faked). WLAN doesn't have to be on, to read this value. </code></pre> <p>3. The BT MAC Address string, available on Android devices with Bluetooth, can be read if your project has the android.permission.BLUETOOTH permission.</p> <pre><code> BluetoothAdapter m_BluetoothAdapter = null; // Local Bluetooth adapter m_BluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); String m_szBTMAC = m_BluetoothAdapter.getAddress(); </code></pre> <p>Returns: 43:25:78:50:93:38 . BT doesn't have to be on, to read it. 4. IMEI only for Android devices with Phone use:</p> <pre><code> TelephonyManager TelephonyMgr = (TelephonyManager)getSystemService(TELEPHONY_SERVICE); String szImei = TelephonyMgr.getDeviceId(); // Requires READ_PHONE_STATE </code></pre> <p>This requires adding a permission in AndroidManifest.xml, and users will be notified upon installing your software: android.permission.READ_PHONE_STATE. The IMEI is unique for your phone and it looks like this: 359881030314356 (unless you have a pre-production device with an invalid IMEI like 0000000000000). For more info <a href="http://www.pocketmagic.net/?p=1662" rel="nofollow">refer</a> this link.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload