Android获取手机配置信息具体实现代码

wzdbszl

wzdbszl

2016-02-19 09:08

下面是个简单易学的Android获取手机配置信息具体实现代码教程,图老师小编详细图解介绍包你轻松学会,喜欢的朋友赶紧get起来吧!
代码如下:

StringBuilder phoneInfo = new StringBuilder();
phoneInfo.append("Product: " + android.os.Build.PRODUCT + System.getProperty("line.separator"));
phoneInfo.append( "CPU_ABI: " + android.os.Build.CPU_ABI + System.getProperty("line.separator"));
phoneInfo.append( "TAGS: " + android.os.Build.TAGS + System.getProperty("line.separator"));
phoneInfo.append( "VERSION_CODES.BASE: " + android.os.Build.VERSION_CODES.BASE + System.getProperty("line.separator"));
phoneInfo.append( "MODEL: " + android.os.Build.MODEL + System.getProperty("line.separator"));
phoneInfo.append( "SDK: " + android.os.Build.VERSION.SDK + System.getProperty("line.separator"));
phoneInfo.append( "VERSION.RELEASE: " + android.os.Build.VERSION.RELEASE + System.getProperty("line.separator"));
phoneInfo.append( "DEVICE: " + android.os.Build.DEVICE + System.getProperty("line.separator"));
phoneInfo.append( "DISPLAY: " + android.os.Build.DISPLAY + System.getProperty("line.separator"));
phoneInfo.append( "BRAND: " + android.os.Build.BRAND + System.getProperty("line.separator"));
phoneInfo.append( "BOARD: " + android.os.Build.BOARD + System.getProperty("line.separator"));
phoneInfo.append( "FINGERPRINT: " + android.os.Build.FINGERPRINT + System.getProperty("line.separator"));
phoneInfo.append( "ID: " + android.os.Build.ID + System.getProperty("line.separator"));
phoneInfo.append( "MANUFACTURER: " + android.os.Build.MANUFACTURER + System.getProperty("line.separator"));
phoneInfo.append( "USER: " + android.os.Build.USER + System.getProperty("line.separator"));
TelephonyManager tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
phoneInfo.append("DeviceId(IMEI) = " + tm.getDeviceId() + System.getProperty("line.separator"));
phoneInfo.append("DeviceSoftwareVersion = " + tm.getDeviceSoftwareVersion() + System.getProperty("line.separator"));
phoneInfo.append("Line1Number = " + tm.getLine1Number() + System.getProperty("line.separator"));
phoneInfo.append("NetworkCountryIso = " + tm.getNetworkCountryIso() + System.getProperty("line.separator"));
phoneInfo.append("NetworkOperator = " + tm.getNetworkOperator() + System.getProperty("line.separator"));
phoneInfo.append("NetworkOperatorName = " + tm.getNetworkOperatorName() + System.getProperty("line.separator"));
phoneInfo.append("NetworkType = " + tm.getNetworkType() + System.getProperty("line.separator"));
phoneInfo.append("PhoneType = " + tm.getPhoneType() + System.getProperty("line.separator"));
phoneInfo.append("SimCountryIso = " + tm.getSimCountryIso() + System.getProperty("line.separator"));
phoneInfo.append("SimOperator = " + tm.getSimOperator() + System.getProperty("line.separator"));
phoneInfo.append("SimOperatorName = " + tm.getSimOperatorName() + System.getProperty("line.separator"));
phoneInfo.append("SimSerialNumber = " + tm.getSimSerialNumber() + System.getProperty("line.separator"));
phoneInfo.append("SimState = " + tm.getSimState() + System.getProperty("line.separator"));
phoneInfo.append("SubscriberId(IMSI) = " + tm.getSubscriberId() + System.getProperty("line.separator"));
phoneInfo.append("VoiceMailNumber = " + tm.getVoiceMailNumber() + System.getProperty("line.separator"));

记得加权限:
代码如下:

uses-permission android:name="android.permission.READ_PHONE_STATE" /
展开更多 50%)
分享

猜你喜欢

Android获取手机配置信息具体实现代码

编程语言 网络编程
Android获取手机配置信息具体实现代码

Android画图并保存图片的具体实现代码

编程语言 网络编程
Android画图并保存图片的具体实现代码

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

android手机获取gps和基站的经纬度地址实现代码

编程语言 网络编程
android手机获取gps和基站的经纬度地址实现代码

android panellistview 圆角实现代码

编程语言 网络编程
android panellistview 圆角实现代码

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

android获取屏幕的长与宽实现代码(手写)

编程语言 网络编程
android获取屏幕的长与宽实现代码(手写)

android屏幕全屏的实现代码

编程语言 网络编程
android屏幕全屏的实现代码

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

C# 系统热键注册实现代码

C# 系统热键注册实现代码

奇妙的js

奇妙的js
下拉加载更多内容 ↓