Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
364 views
in Technique[技术] by (71.8m points)

android - 是否有唯一的Android设备ID?(Is there a unique Android device ID?)

Android设备是否具有唯一的ID,如果是,则使用Java访问它的简单方法是什么?

  ask by Tyler translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Settings.Secure#ANDROID_ID returns the Android ID as an unique for each user 64-bit hex string. (Settings.Secure#ANDROID_ID 以每个用户 64位十六进制字符串的唯一身份返回Android ID。)

import android.provider.Settings.Secure;

private String android_id = Secure.getString(getContext().getContentResolver(),
                                                        Secure.ANDROID_ID); 

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...