Android Build類的詳解及簡單實例
Android Build類的詳解及簡單實例
一、類結(jié)構(gòu):
java.lang.Object ? android.os.Build
二、類概述:從系統(tǒng)屬性中提取設(shè)備硬件和版本信息。
三、內(nèi)部類:
1、Build.VERSION 各種版本字符串
2、Build.VERSION_CODES 目前已知的版本代碼的枚舉類
四、常量:UNKNOWN 當(dāng)一個版本屬性不知道時所設(shè)定的值。其字符串值為 unknown .
五、構(gòu)造方法: Build ()
六、靜態(tài)屬性
1、BOARD 主板:The name of the underlying board, like goldfish.
2、BOOTLOADER 系統(tǒng)啟動程序版本號: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 唯一識別碼: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 整個產(chǎn)品的名稱:The name of the overall product.
15、RADIO 無線電固件版本:The radio firmware version number. 在API14后已過時。使用getRadioVersion()代替。
16、SERIAL 硬件序列號: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() 獲取無線電固件版本
八、測試示例:
public static String getDeviceInfo() { StringBuffer sb = new StringBuffer(); sb.append("主板: "+ Build.BOARD+"\n"); sb.append("系統(tǒng)啟動程序版本號: " + 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("硬件識別碼:" + 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("硬件序列號:" + 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ū)交流討論,感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
- Android設(shè)計模式之Builder模式詳解
- Android 中build.prop 文件與 getprop 命令
- Android Studio 當(dāng)build時候出錯解決辦法
- Android 中StringBuffer 和StringBuilder常用方法
- Android使alertDialog.builder不會點(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對話框AlertDialog.Builder使用方法詳解
相關(guān)文章
Android消息推送:手把手教你集成小米推送(附demo)
本篇文章主要介紹了Android消息推送:手把手教你集成小米推送,非常具有實用價值,需要的朋友可以參考下。2016-12-12android studio3.0以上如何通過navicat訪問SQLite數(shù)據(jù)庫文件
這篇文章主要介紹了android studio3.0以上如何通過navicat訪問SQLite數(shù)據(jù)庫文件,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-06-06Android中的導(dǎo)航navigation的使用詳細(xì)步驟
在Android中,導(dǎo)航主要通過使用Navigation SDK來實現(xiàn),該SDK提供了一組工具和組件,可以幫助開發(fā)人員構(gòu)建具有一致性和可訪問性的用戶界面,這篇文章主要介紹了Android中的導(dǎo)航navigation的使用詳細(xì)步驟,需要的朋友可以參考下2024-04-04Android Zipalign工具優(yōu)化Android APK應(yīng)用
本文主要介紹Android Zipalign工具優(yōu)化Android APK應(yīng)用,這里整理了相關(guān)資料及簡單優(yōu)化實例,有需要的小伙伴可以參考下2016-09-09Android中創(chuàng)建對話框(確定取消對話框、單選對話框、多選對話框)實例代碼
這篇文章主要介紹了詳解Android中創(chuàng)建對話框(確定取消對話框、單選對話框、多選對話框)的相關(guān)資料,需要的朋友可以參考下2016-04-04Android實現(xiàn)新手引導(dǎo)半透明蒙層效果
這篇文章主要為大家詳細(xì)介紹了Android實現(xiàn)新手引導(dǎo)半透明蒙層效果,具有一定的參考價值,感興趣的小伙伴們可以參考一下2019-03-03Flutter定義tabbar底部導(dǎo)航路由跳轉(zhuǎn)的方法
這篇文章主要為大家詳細(xì)介紹了Flutter定義tabbar底部導(dǎo)航路由跳轉(zhuǎn)的方法,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下2022-07-07Android應(yīng)用程序保持后臺喚醒(使用WakeLock實現(xiàn))
本篇文章主要介紹了使用WakeLock使Android應(yīng)用程序保持后臺喚醒的相關(guān)知識。具有很好的參考價值。下面跟著小編一起來看下吧2017-04-04android開發(fā)教程之系統(tǒng)資源的使用方法 android資源文件
這篇文章主要介紹了android中的系統(tǒng)資源的使用方法,包括顏色資源 、字符串資源、尺寸資源、XML資源文件,需要的朋友可以參考下2014-02-02