我是靠谱客的博主 幸福含羞草,最近开发中收集的这篇文章主要介绍获取android设备唯一编号_获取 Android 设备的唯一标识码,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

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 设备的唯一标识码所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(48)

评论列表共有 0 条评论

立即
投稿
返回
顶部