Android unique id

前端 未结 6 1675
慢半拍i
慢半拍i 2020-12-05 03:32

How do I get an unique ID from an Android phone?

Whenever I try to get the unique ID from the phone as a string it always shows android id and no other uniq

6条回答
  •  囚心锁ツ
    2020-12-05 04:04

    ((TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId();
    

    with manifest

    
    

    Edit:

    Here is some interesting reading about the android id:

    How to set the Android ID

    Android ID Requires Market Login

    Try setting it to something other than 'android id' and see if you read the new value.

提交回复
热议问题