編輯:關於Android編程
一、類結構:
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() 獲取無線電固件版本
八、測試示例:
package com.home.build;
import android.app.Activity;
import android.os.Build;
import android.os.Bundle;
import android.widget.TextView;
public class MainActivity extends Activity {
private TextView showText;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
showText = (TextView) findViewById(R.id.main_tv);
showText.setText(getDeviceInfo());
}
/**
* 獲取設備信息
*
* @return
*/
private String getDeviceInfo() {
StringBuffer sb = new StringBuffer();
sb.append(主板: + Build.BOARD);
sb.append(
系統啟動程序版本號: + Build.BOOTLOADER);
sb.append(
系統定制商: + Build.BRAND);
sb.append(
cpu指令集: + Build.CPU_ABI);
sb.append(
cpu指令集2 + Build.CPU_ABI2);
sb.append(
設置參數: + Build.DEVICE);
sb.append(
顯示屏參數: + Build.DISPLAY);
sb.append(www.2cto.com
無線電固件版本: + Build.getRadioVersion());
sb.append(
硬件識別碼: + Build.FINGERPRINT);
sb.append(
硬件名稱: + Build.HARDWARE);
sb.append(
HOST: + Build.HOST);
sb.append(
修訂版本列表: + Build.ID);
sb.append(
硬件制造商: + Build.MANUFACTURER);
sb.append(
版本: + Build.MODEL);
sb.append(
硬件序列號: + Build.SERIAL);
sb.append(
手機制造商: + Build.PRODUCT);
sb.append(
描述Build的標簽: + Build.TAGS);
sb.append(
TIME: + Build.TIME);
sb.append(
builder類型: + Build.TYPE);
sb.append(
USER: + Build.USER);
return sb.toString();
}
}
Android 自定義SeekBar,讓進度條變得個性起來
許多應用可能需要加入進度,例如下載、播放視頻、音頻、讀取數據庫等等,都需要一個等待狀態的進度條。原生的進度條的確不美觀,今天這篇小案例,就讓咱們的進度條“靓起
Android使用SQLite數據庫的簡單實例
先畫個圖,了解下Android下數據庫操作的簡單流程:1.首先,寫一個自己的數據庫操作幫助類,這個類繼承自Android自帶的SQLiteOpenHelper.2.在自己
Android 非靜態內部類導致內存洩漏原因深入剖析
背景上周發現蘑菇街IM-Android代碼裡面,一些地方代碼編寫不當,存在內存洩漏的問題,在和瘋紫交流的過程中,發現加深了一些理解,所以決定寫一下分析思路,相互學習。內存
Android應用開發中RecyclerView組件使用入門教程
RecyclerView是一種列表容器, 發布很久了, 才想起來寫點什麼.RecyclerView相比於ListView, 在回收重用時更具有靈活性, 也就是低耦合, 並