Android.os包中一些类的使用
Android.os.Build
Build.BOARD // 主板 Build.BRAND // android系统定制商 Build.CPU_ABI // cpu指令集 Build.DEVICE // 设备参数 Build.DISPLAY // 显示屏参数 Build.FINGERPRINT // 硬件名称 Build.HOST Build.ID // 修订版本列表 Build.MANUFACTURER // 硬件制造商 Build.MODEL // 版本 Build.PRODUCT // 手机制造商 Build.TAGS // 描述build的标签 Build.TIME Build.TYPE // builder类型 Build.USER // 运行结果 /* board: unknown brand: generic cpu abi: armeabi device: generic display: google_sdk-eng 2.1 ERD79 22607 test-keys finger print: generic/google_sdk/generic/:2.1/ERD79/22607:eng/test-keys host: genki.mtv.corp.google.com id: ERD79 manufacturer: unknown model: google_sdk product: google_sdk tags: test-keys time: 1261185425000 type: eng user: android-build */
Build.BOARD // 主板 Build.BRAND // android系统定制商 Build.CPU_ABI // cpu指令集 Build.DEVICE // 设备参数 Build.DISPLAY // 显示屏参数 Build.FINGERPRINT // 硬件名称 Build.HOST Build.ID // 修订版本列表 Build.MANUFACTURER // 硬件制造商 Build.MODEL // 版本 Build.PRODUCT // 手机制造商 Build.TAGS // 描述build的标签 Build.TIME Build.TYPE // builder类型 Build.USER // 运行结果 /* board: unknown brand: generic cpu abi: armeabi device: generic display: google_sdk-eng 2.1 ERD79 22607 test-keys finger print: generic/google_sdk/generic/:2.1/ERD79/22607:eng/test-keys host: genki.mtv.corp.google.com id: ERD79 manufacturer: unknown model: google_sdk product: google_sdk tags: test-keys time: 1261185425000 type: eng user: android-build */
Build.VERSION
// 当前开发代号 Build.VERSION.CODENAME // 源码控制版本号 Build.VERSION.INCREMENTAL // 版本字符串 Build.VERSION.RELEASE // 版本号 Build.VERSION.SDK // 版本号 Build.VERSION.SDK_INT // 结果 /* REL 22607 2.1 7 7 */ // Build.VERSION.SDK_INT可与switch搭配用 switch (Build.VERSION.SDK_INT) { case Build.VERSION_CODES.BASE: // 1.0 break; case Build.VERSION_CODES.BASE_1_1: // 1.1 break; case Build.VERSION_CODES.CUPCAKE: // 1.5 break; case Build.VERSION_CODES.CUR_DEVELOPMENT: // current dev version break; case Build.VERSION_CODES.DONUT: // 1.6 break; case Build.VERSION_CODES.ECLAIR: // 2.0 break; case Build.VERSION_CODES.ECLAIR_0_1: // 2.0.1 break; case Build.VERSION_CODES.ECLAIR_MR1: // 2.1 break; case Build.VERSION_CODES.FROYO: // 2.2 break; case Build.VERSION_CODES.GINGERBREAD: // 2.3 break; case Build.VERSION_CODES.GINGERBREAD_MR1: // 2.3.3 break; case Build.VERSION_CODES.HONEYCOMB: // 3.0 break; case Build.VERSION_CODES.HONEYCOMB_MR1: // 3.1 break; case Build.VERSION_CODES.HONEYCOMB_MR2: // 3.2 break; case Build.VERSION_CODES.ICE_CREAM_SANDWICH: // 4.0 break; case Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1: // 4.03 break; case Build.VERSION_CODES.JELLY_BEAN: // 4.1 break; case Build.VERSION_CODES.JELLY_BEAN_MR1: // 4.2 break; case Build.VERSION_CODES.JELLY_BEAN_MR2: // 4.3 break; case Build.VERSION_CODES.KITKAT: // 4.4 break; }
相关推荐
绿豆饼 2020-07-28
huha 2020-10-16
xfcyhades 2020-11-20
sgafdsg 2020-11-04
Michael 2020-11-03
fengyeezju 2020-10-14
ziyexiaoxiao 2020-10-14
业余架构师 2020-10-09
OuNuo0 2020-09-29
moses 2020-09-22
Angelia 2020-09-11
qinxu 2020-09-10
刘炳昭 2020-09-10
Nostalgiachild 2020-09-07
Nostalgiachild 2020-08-17
leavesC 2020-08-14
一青年 2020-08-13
AndroidAiStudy 2020-08-07
ydc0 2020-07-30