Android獲取手機配置信息具體實現(xiàn)代碼
更新時間:2013年06月16日 16:50:19 作者:
下面為大家介紹下使用android獲取手機配置信息的具體過程,感興趣的朋友可以參考下哈,希望對你有所幫助
復(fù)制代碼 代碼如下:
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"));
記得加權(quán)限:
復(fù)制代碼 代碼如下:
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
相關(guān)文章
Android實現(xiàn)炫酷的網(wǎng)絡(luò)直播彈幕功能
這篇文章主要為大家詳細介紹了Android仿網(wǎng)絡(luò)直播彈幕功能的實現(xiàn)方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下2016-11-11
Android開發(fā)之獲取短信驗證碼后按鈕背景變化并且出現(xiàn)倒計時
在開發(fā)是經(jīng)常會遇到獲取短信驗證碼,然后獲取驗證碼后需要等待n秒倒計時,這時是不能再次發(fā)送短信請求的,這是需要一個倒計時程序,本文給大家分享了實現(xiàn)此功能的代碼,需要的朋友參考下2016-01-01
Android3.0 ActionBar導(dǎo)航標(biāo)題欄使用解析
這篇文章主要為大家詳細解析了Android3.0 ActionBar導(dǎo)航標(biāo)題欄的使用方法,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-01-01

