Android Build類的詳解及簡(jiǎn)單實(shí)例
Android Build類的詳解及簡(jiǎn)單實(shí)例
一、類結(jié)構(gòu):
java.lang.Object ? android.os.Build
二、類概述:從系統(tǒng)屬性中提取設(shè)備硬件和版本信息。
三、內(nèi)部類:
1、Build.VERSION 各種版本字符串
2、Build.VERSION_CODES 目前已知的版本代碼的枚舉類
四、常量:UNKNOWN 當(dāng)一個(gè)版本屬性不知道時(shí)所設(shè)定的值。其字符串值為 unknown .
五、構(gòu)造方法: Build ()
六、靜態(tài)屬性
1、BOARD 主板:The name of the underlying board, like goldfish.
2、BOOTLOADER 系統(tǒng)啟動(dòng)程序版本號(hào):The system bootloader version number.
3、BRAND 系統(tǒng)定制商:The consumer-visible brand with which the product/hardware will be associated, if any.
4、CPU_ABI cpu指令集:The name of the instruction set (CPU type + ABI convention) of native code.
5、CPU_ABI2 cpu指令集2:The name of the second instruction set (CPU type + ABI convention) of native code.
6、DEVICE 設(shè)備參數(shù):The name of the industrial design.
7、DISPLAY 顯示屏參數(shù):A build ID string meant for displaying to the user
8、FINGERPRINT 唯一識(shí)別碼:A string that uniquely identifies this build. Do not attempt to parse this value.
9、HARDWARE 硬件名稱:The name of the hardware (from the kernel command line or /proc).
10、HOST
11、ID 修訂版本列表:Either a changelist number, or a label like M4-rc20.
12、MANUFACTURER 硬件制造商:The manufacturer of the product/hardware.
13、MODEL 版本即最終用戶可見的名稱:The end-user-visible name for the end product.
14、PRODUCT 整個(gè)產(chǎn)品的名稱:The name of the overall product.
15、RADIO 無線電固件版本:The radio firmware version number. 在API14后已過時(shí)。使用getRadioVersion()代替。
16、SERIAL 硬件序列號(hào):A hardware serial number, if available. Alphanumeric only, case-insensitive.
17、TAGS 描述build的標(biāo)簽,如未簽名,debug等等。:Comma-separated tags describing the build, like unsigned,debug.
18、TIME
19、TYPE build的類型:The type of build, like user or eng.
20、USER
七、公共方法:
public static String getRadioVersion() 獲取無線電固件版本
八、測(cè)試示例:
public static String getDeviceInfo() {
StringBuffer sb = new StringBuffer();
sb.append("主板: "+ Build.BOARD+"\n");
sb.append("系統(tǒng)啟動(dòng)程序版本號(hào): " + Build.BOOTLOADER+"\n");
sb.append("系統(tǒng)定制商:" + Build.BRAND+"\n");
sb.append("cpu指令集: " + Build.CPU_ABI+"\n");
sb.append("cpu指令集2 "+ Build.CPU_ABI2+"\n");
sb.append("設(shè)置參數(shù): "+ Build.DEVICE+"\n");
sb.append("顯示屏參數(shù):" + Build.DISPLAY+"\n");
sb.append("無線電固件版本:" + Build.getRadioVersion()+"\n");
sb.append("硬件識(shí)別碼:" + Build.FINGERPRINT+"\n");
sb.append("硬件名稱:" + Build.HARDWARE+"\n");
sb.append("HOST: " + Build.HOST+"\n");
sb.append("修訂版本列表:" + Build.ID+"\n");
sb.append("硬件制造商:" + Build.MANUFACTURER+"\n");
sb.append("版本:" + Build.MODEL+"\n");
sb.append("硬件序列號(hào):" + Build.SERIAL+"\n");
sb.append("手機(jī)制造商:" + Build.PRODUCT+"\n");
sb.append("描述Build的標(biāo)簽:" + Build.TAGS+"\n");
sb.append("TIME: " + Build.TIME+"\n");
sb.append("builder類型:" + Build.TYPE+"\n");
sb.append("USER: " + Build.USER+"\n");
return sb.toString();
}
如有疑問請(qǐng)留言或者到本站社區(qū)交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!
- Android設(shè)計(jì)模式之Builder模式詳解
- Android 中build.prop 文件與 getprop 命令
- Android Studio 當(dāng)build時(shí)候出錯(cuò)解決辦法
- Android 中StringBuffer 和StringBuilder常用方法
- Android使alertDialog.builder不會(huì)點(diǎn)擊外面和按返回鍵消失的方法
- Android Gradle Build Error:Some file crunching failed, see logs for details解決辦法
- Android中用Builder模式自定義Dialog的方法
- Android Gradle Build Error:Some file crunching failed, see logs for details的快速解決方法
- Android 解決build path errors的問題
- Android對(duì)話框AlertDialog.Builder使用方法詳解
相關(guān)文章
Android實(shí)現(xiàn)app應(yīng)用多語言切換功能
這篇文章主要為大家詳細(xì)介紹了Android實(shí)現(xiàn)app應(yīng)用多語言切換功能的相關(guān)資料,類似于微信的語言切換,感興趣的小伙伴們可以參考一下2016-08-08
Android控件實(shí)現(xiàn)直播App點(diǎn)贊飄心動(dòng)畫
這篇文章主要為大家詳細(xì)介紹了FlowLikeView控件實(shí)現(xiàn)直播App特效之點(diǎn)贊飄心動(dòng)畫,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2018-03-03
android使用NotificationListenerService監(jiān)聽通知欄消息
本篇文章主要介紹了android使用NotificationListenerService監(jiān)聽通知欄消息,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下。2017-01-01
Android客制化adb shell進(jìn)去后顯示shell@xxx的標(biāo)識(shí)
今天小編就為大家分享一篇關(guān)于Android客制化adb shell進(jìn)去后顯示shell@xxx的標(biāo)識(shí),小編覺得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來看看吧2018-12-12
Kotlin高效實(shí)現(xiàn) Android ViewPager2 頂部導(dǎo)航之動(dòng)態(tài)配置與性能優(yōu)化指
文章介紹了使用AndroidViewPager2和TabLayout實(shí)現(xiàn)高效頂部導(dǎo)航的方法,并提供了優(yōu)化指南,包括避免不必要的Fragment實(shí)例化、動(dòng)態(tài)配置頁面、使用Kotlin特性減少冗余代碼等,通過這些優(yōu)化,代碼變得更加高效、簡(jiǎn)潔和易于維護(hù),感興趣的朋友跟隨小編一起看看吧2025-03-03
Android客戶端與服務(wù)端數(shù)據(jù)加密傳輸方案詳解
這篇文章主要為大家介紹了Android客戶端與服務(wù)端數(shù)據(jù)加密傳輸方案詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-01-01
自定義滑動(dòng)按鈕為例圖文剖析Android自定義View繪制
這篇文章主要介紹了自定義滑動(dòng)按鈕的例子,圖文剖析Android自定義View繪制,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2016-03-03

