android开发分享Android获取手机配置信息具体实现代码

复制代码 代码如下: stringbuilder phoneinfo = new stringbuilder(); phoneinfo.append(“product: “

复制代码 代码如下:
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” />

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/addevelopment/939548.html

(0)
上一篇 2021年11月13日
下一篇 2021年11月13日

精彩推荐