Android 设备是否有唯一 ID,如果有,使用 Java 访问它的简单方法是什么?
最佳答案
Settings.Secure#ANDROID_ID
返回 Android ID 作为 unique for each user 64 位十六进制字符串。
import android.provider.Settings.Secure;
private String android_id = Secure.getString(getContext().getContentResolver(),
Secure.ANDROID_ID);
另请阅读唯一标识符的最佳做法:https://developer.android.com/training/articles/user-data-ids
https://stackoverflow.com/questions/2785485/
相关文章:
android - 如何在 TextView 中水平和垂直居中文本?
android - 如何在 Android 的 ListView 中延迟加载图像
android - Android 上的 'Context' 是什么?
android - match_parent 和 fill_parent 有什么区别?
android - 如何使用保存实例状态保存 Activity 状态?
android - 旋转Android上的 Activity 重启
android - Android中的gravity和layout_gravity有什么区别?
android - 如何在Android中将屏幕尺寸作为像素获取