获取Android(安卓)唯一标识
16lz
2021-12-04
1.使用ANDROID_ID
import android.provider.Settings.Secure;
private String android_id = Secure.getString(getContext().getContentResolver(),
Secure.ANDROID_ID);
这个值应该是在系统第一次启动后计算出来的,设备恢复出厂设置之后,再次启动这个值可能会改变。
2.2版本的会有问题。
2.使用wifi网卡mac地址
WifiManager wm = (WifiManager)Ctxt.getSystemService(Context.WIFI_SERVICE);
wm.getConnectionInfo().getMacAddress();
3.Device ID
String deviceId = ((TelephonyManager) context.getSystemService( Context.TELEPHONY_SERVICE )).getDeviceId();
|
更多相关文章
- 箭头函数的基础使用
- NPM 和webpack 的基础使用
- Python list sort方法的具体使用
- 【阿里云镜像】使用阿里巴巴DNS镜像源——DNS配置教程
- 【Android外文翻译 - 02】判断是否可以使用某个Intent
- android之PendingIntent使用
- Android剪贴板操作
- Android中获取应用程序(包)的信息-----PackageManager的使用(一)
- Android(安卓)fragment在xml中使用没添加ID