Android ---- Build class
I. Class Structure:
Java. lang. Object |
? |
Android. OS. Build |
Ii. Category Overview: extract device hardware and version information from system attributes.
Iii. Internal class:
1. Build. VERSION strings of various versions
2. Build. VERSION_CODES enumeration class of the currently known version code
4. Constant: the value set by UNKNOWN when a version attribute is UNKNOWN. The string value is unknown.
5. constructor: Build ()
Vi. Static attributes
1. BOARD board: The name of the underlying BOARD, like goldfish.
2. BOOTLOADER system startup program version: The system bootloader version number.
3. BRAND system customizer: The consumer-visible brand with which the product/hardware will be associated, if any.
4. CPU_ABI cpu instruction set: The name of the instruction set (CPU type + ABI convention) of native code.
5. CPU_ABI2 cpu instruction set 2: The name of the second instruction set (CPU type + ABI convention) of native code.
6. DEVICE parameter: The name of the industrial design.
7. DISPLAY parameters: A build ID string meant for displaying to the user
8. FINGERPRINT unique identifier: A string that uniquely identifies this build. Do not attempt to parse this value.
9. HARDWARE hardware name: The name of the HARDWARE (from the kernel command line or/proc ).
10. HOST
11. ID revision list: Either a changelist number, or a label like M4-rc20.
12. MANUFACTURER hardware manufacturer: The MANUFACTURER of the product/hardware.
13. The MODEL version is the name visible to The end user: the end-user-visible name for The end product.
14. The name of the entire PRODUCT: The name of the overall product.
15. RADIO radio firmware version: The RADIO firmware version number. expired after API14. UseInstead of getRadioVersion.
16. SERIAL hardware serial number: A hardware SERIAL number, if available. Alphanumeric only, case-insensitive.
17. TAGS describes the build labels, such as unsigned and debug. : Comma-separated tags describing the build, like unsigned, debug.
18. TIME
19. TYPE build type: The TYPE of build, like user or eng.
20. USER
VII. Public methods:
Public static String getRadioVersion () Get the radio firmware version
8. test example:
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 ();}/*** get device information ** @ return */private String getDeviceInfo () {StringBuffer sb = new StringBuffer (); sb. append (motherboard: + Build. BOARD); sb. append (System Startup Program version: + Build. BOOTLOADER); sb. append (system customizer: + Build. BRAND); sb. append (cpu Instruction Set: + Build. CPU_ABI); sb. append (cpu Instruction Set 2 + Build. CPU_ABI2); sb. append (set parameter: + Build. DEVICE); sb. append (display parameters: + Build. DISPLAY); sb. append (www.bkjia.com radio firmware version: + Build. getRadioVersion (); sb. append (hardware identifier: + Build. FINGERPRINT); sb. append (hardware name: + Build. HARDWARE); sb. append (HOST: + Build. HOST); sb. append (version list: + Build. ID); sb. append (hardware manufacturer: + Build. MANUFACTURER); sb. append (Version: + Build. MODEL); sb. append (hardware serial number: + Build. SERIAL); sb. append (mobile phone manufacturer: + Build. PRODUCT); sb. append (label describing Build: + Build. TAGS); sb. append (TIME: + Build. TIME); sb. append (builder type: + Build. TYPE); sb. append (USER: + Build. USER); return sb. toString ();}}