新聞中心
Android開(kāi)發(fā)平臺(tái)中,可通過(guò)TelephonyManager 獲取本機(jī)號(hào)碼。

在如東等地區(qū),都構(gòu)建了全面的區(qū)域性戰(zhàn)略布局,加強(qiáng)發(fā)展的系統(tǒng)性、市場(chǎng)前瞻性、產(chǎn)品創(chuàng)新能力,以專(zhuān)注、極致的服務(wù)理念,為客戶(hù)提供網(wǎng)站建設(shè)、成都做網(wǎng)站 網(wǎng)站設(shè)計(jì)制作按需規(guī)劃網(wǎng)站,公司網(wǎng)站建設(shè),企業(yè)網(wǎng)站建設(shè),高端網(wǎng)站設(shè)計(jì),全網(wǎng)營(yíng)銷(xiāo)推廣,成都外貿(mào)網(wǎng)站制作,如東網(wǎng)站建設(shè)費(fèi)用合理。
java代碼:
- TelephonyManager phoneMgr=(TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);
- txtPhoneNumber.setText(phoneMgr.getLine1Number()); //txtPhoneNumber是一個(gè)EditText 用于顯示手機(jī)號(hào)
注:根據(jù)Android的安全機(jī)制,在使用TelephonyManager時(shí),必須在AndroidManifest.xml中添加
手機(jī)型號(hào) Build.MODEL
java代碼:
- private void loadPhoneStatus(){
- TelephonyManager phoneMgr=(TelephonyManager)this.getSystemService(Context.TELEPHONY_SERVICE);
- txtPhoneModel.setText(Build.MODEL); //手機(jī)型號(hào)
- txtPhoneNumber.setText(phoneMgr.getLine1Number());//本機(jī)電話(huà)號(hào)碼
- txtSdkVersion.setText(Build.VERSION.SDK);//SDK版本號(hào)
- txtOsVersion.setText(Build.VERSION.RELEASE);//Firmware/OS 版本號(hào)
- }
事實(shí)上,Build能向我們提供包括 硬件廠商,硬件編號(hào),序列號(hào)等很多信息 調(diào)用方法也都同上,很簡(jiǎn)單。
Java代碼:
- String
- BOARD
- The name of the underlying board, like "goldfish".
- String
- BOOTLOADER
- The system bootloader version number.
- String
- BRAND
- The brand (e.g., carrier) the software is customized for, if any.
- String
- CPU_ABI
- The name of the instruction set (CPU type + ABI convention) of native code.
- String
- CPU_ABI2
- The name of the second instruction set (CPU type + ABI convention) of native code.
- String
- DEVICE
- The name of the industrial design.
- String
- DISPLAY
- A build ID string meant for displaying to the user
- String
- FINGERPRINT
- A string that uniquely identifies this build.
- String
- HARDWARE
- The name of the hardware (from the kernel command line or /proc).
- String
- HOST
- String
- ID
- Either a changelist number, or a label like "M4-rc20".
- String
- MANUFACTURER
- The manufacturer of the product/hardware.
- String
- MODEL
- The end-user-visible name for the end product.
- String
- PRODUCT
- The name of the overall product.
- String
- RADIO
- The radio firmware version number.
- String
- SERIAL
- A hardware serial number, if available.
- String
- TAGS
- Comma-separated tags describing the build, like "unsigned,debug".
- long
- TIME
- String
- TYPE
- The type of build, like "user" or "eng".
- String
- UNKNOWN
- Value used for when a build property is unknown.
- String
- USER
效果圖:
【編輯推薦】
Android UI設(shè)計(jì)模式
Android開(kāi)發(fā)之旅:Android架構(gòu)
Android Phone 7界面設(shè)置小教程
Android系統(tǒng)手機(jī)隱藏代碼大全曝光
Android Activity和Intent機(jī)制學(xué)習(xí)筆記
網(wǎng)站欄目:Android中獲取手機(jī)信息
網(wǎng)頁(yè)鏈接:http://www.5511xx.com/article/djhosjo.html


咨詢(xún)
建站咨詢(xún)
