Android中如何獲取手機(jī)信息-創(chuàng)新互聯(lián)

這篇文章主要介紹“Android中如何獲取手機(jī)信息”的相關(guān)知識(shí),小編通過(guò)實(shí)際案例向大家展示操作過(guò)程,操作方法簡(jiǎn)單快捷,實(shí)用性強(qiáng),希望這篇“Android中如何獲取手機(jī)信息”文章能幫助大家解決問(wèn)題。

華陰網(wǎng)站建設(shè)公司成都創(chuàng)新互聯(lián)公司,華陰網(wǎng)站設(shè)計(jì)制作,有大型網(wǎng)站制作公司豐富經(jīng)驗(yàn)。已為華陰成百上千提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\外貿(mào)網(wǎng)站制作要多少錢,請(qǐng)找那個(gè)售后服務(wù)好的華陰做網(wǎng)站的公司定做!

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

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中添加<uses-permission android:name="READ_PHONE_STATE" /> 否則無(wú)法獲得系統(tǒng)的許可。
手機(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ī)電話號(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中如何獲取手機(jī)信息

關(guān)于“Android中如何獲取手機(jī)信息”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí),可以關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,小編每天都會(huì)為大家更新不同的知識(shí)點(diǎn)。

當(dāng)前題目:Android中如何獲取手機(jī)信息-創(chuàng)新互聯(lián)
當(dāng)前URL:http://bm7419.com/article26/dscpcg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供虛擬主機(jī)、品牌網(wǎng)站制作營(yíng)銷型網(wǎng)站建設(shè)、搜索引擎優(yōu)化、網(wǎng)站排名、小程序開發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站制作