Android Build类的详解及简单实例
作者:cjwsimple 发布时间:2023-07-02 21:12:45
Android Build类的详解及简单实例
一、类结构:
java.lang.Object
? android.os.Build
二、类概述:从系统属性中提取设备硬件和版本信息。
三、内部类:
1、Build.VERSION 各种版本字符串
2、Build.VERSION_CODES 目前已知的版本代码的枚举类
四、常量:UNKNOWN 当一个版本属性不知道时所设定的值。其字符串值为 unknown .
五、构造方法: Build ()
六、静态属性
1、BOARD 主板:The name of the underlying board, like goldfish.
2、BOOTLOADER 系统启动程序版本号:The system bootloader version number.
3、BRAND 系统定制商: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 设备参数:The name of the industrial design.
7、DISPLAY 显示屏参数: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 整个产品的名称: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的标签,如未签名,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("系统启动程序版本号: " + Build.BOOTLOADER+"\n");
sb.append("系统定制商:" + Build.BRAND+"\n");
sb.append("cpu指令集: " + Build.CPU_ABI+"\n");
sb.append("cpu指令集2 "+ Build.CPU_ABI2+"\n");
sb.append("设置参数: "+ Build.DEVICE+"\n");
sb.append("显示屏参数:" + 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("手机制造商:" + Build.PRODUCT+"\n");
sb.append("描述Build的标签:" + Build.TAGS+"\n");
sb.append("TIME: " + Build.TIME+"\n");
sb.append("builder类型:" + Build.TYPE+"\n");
sb.append("USER: " + Build.USER+"\n");
return sb.toString();
}
来源:http://blog.csdn.net/man_embedded/article/details/52166161
猜你喜欢
- 在 fluro 中,定义路由处理器 Handler 时可以指定该页面的默认转场形式,或者在使用 navigateTo 方法是可以设置页面跳转
- Console.WriteLine("This is a Client, host name is {0}", Dns.
- 本文实例讲述了C#实现对Json字符串处理方法,分享给大家供大家参考。具体分析如下:一般对于web应用开发人员来说对Json字符串都会很熟悉
- 一、方法这里我们用两种方法来实现跑马灯效果,虽然实质上是一种实质就是:1、TextView调出跑马灯效果2、TextView获取焦点&nbs
- ImageCacheconst int _kDefaultSize = 1000;const int _kDefaultSizeBytes
- C# 关于Invoke首先说下,invoke和begininvoke的使用有两种情况:control中的invoke、begininvoke
- Navigator 的 push 和 pop方法Navigator 导航器的 push 和 pop 方法可以携带参数在页面间传递,其他变形的
- 问题:在用Java程序进行读写含中文的txt文件时,经常会出现读出或写入的内容会出现乱码。原因其实很简单,就是系统的编码和程序的编码采用了不
- 大致分为以下几个方面:一些查询指令整理使用SQL语句进行特殊查询检测表字段是否存在数据库升级数据库表字段赋初始值一、查询指令整理1.链式执行
- 您已经看到很多包含视频内容的应用程序,比如带有视频教程的食谱应用程序、电影应用程序和体育相关的应用程序。您是否想知道如何将视频内容添加到您的
- /// <summary> /// 遍历Co
- 错误处理到目前为止,我们都没怎么介绍onComplete()和onError()函数。这两个函数用来通知订阅者,被观察的对象将停止发送数据以
- 逆时针画圆弧,原理:将360度分割成36份,分别标出每10度角度时的坐标点,然后将每个点连接起来。 #include <io
- 前言通过此篇文章,你将了解到:Flutter windows和Android桌面应用屏幕适配的解决方案;屏幕适配的相关知识和原理;flutt
- 前言这里主要简单介绍如何使用Camera+SurfaceView自定义相机拍照,如果是Camera2或者是TextureView的可以前往主
- mapper文件使用in("str1","str2")mybatis的xxxMapper.xml文件
- 1、volley 项目地址 https://github.com/smanikandan14/Volley-demo (1)&nb
- 一. 线性表中的顺序表线性表(linear list)是n个具有相同特性的数据元素的有限序列。 线性表是一种在实际中广泛使用的数据结构,常见
- 【程序1】题目:有1、2、3、4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少?1.程序分析:可填在百位、十位、个位的数字都是1
- Spring JPA 增加字段执行异常用Spring jpa Entity里面增加了几个字段,但启动报错,提示column Unable t