概述
importandroid.provider.Settings.Secure;
privateString android_id =
Secure.getString(getBaseContext().getContentResolver(),
Secure.ANDROID_ID);
importandroid.provider.Settings.Secure;
privateString android_id =
Secure.getString(getBaseContext().getContentResolver(),
Secure.ANDROID_ID);
或者
import Android.Provider.Settings.System;
String Android_ID =
System.getString(this.getContentResolver(), System.ANDROID_ID);
或者
1.获取手机设备的唯一码(IMIE )
public void fetch_status(){
TelephonyManager tm = (TelephonyManager) this
.getSystemService(Context.TELEPHONY_SERVICE);//
String str = "";
str += "DeviceId(IMEI) = " + tm.getDeviceId() + "n";
str += "DeviceSoftwareVersion = " + tm.getDeviceSoftwareVersion() +
"n";
str += "Line1Number = " + tm.getLine1Number() + "n";
str += "NetworkCountryIso = " + tm.getNetworkCountryIso() +
"n";
str += "NetworkOperator = " + tm.getNetworkOperator() + "n";
str += "NetworkOperatorName = " + tm.getNetworkOperatorName() +
"n";
str += "NetworkType = " + tm.getNetworkType() + "n";
str += "PhoneType = " + tm.getPhoneType() + "n";
str += "SimCountryIso = " + tm.getSimCountryIso() + "n";
str += "SimOperator = " + tm.getSimOperator() + "n";
str += "SimOperatorName = " + tm.getSimOperatorName() + "n";
str += "SimSerialNumber = " + tm.getSimSerialNumber() + "n";
str += "SimState = " + tm.getSimState() + "n";
str += "SubscriberId(IMSI) = " + tm.getSubscriberId() + "n";
str += "VoiceMailNumber = " + tm.getVoiceMailNumber() + "n";
TextView sys = (TextView) findViewById(R.id.sys);
sys.setText(str);
}
2.在AndroidManifest.xml里添加权限
最后
以上就是幸福含羞草为你收集整理的获取android设备唯一编号_获取 Android 设备的唯一标识码的全部内容,希望文章能够帮你解决获取android设备唯一编号_获取 Android 设备的唯一标识码所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复