First, class structure:
java.lang.object |
   ? |
android.os.build |
Second, class overview: Extract device Hardware and version information from System Properties.
Third, the internal class:
1. Build.version various version strings
2. Enumeration class for build.version_codes currently known version code
Iv. constants: UNKNOWN The value that is set when a version property is not known. Its string value is "Unknown".
Five, construction method: Build ()
Vi. Static Properties
1. BOARD Motherboard: The name of the underlying BOARD, like "goldfish".
2. BOOTLOADER System Boot Program version number: the BOOTLOADER.
3. Brand System Customizer: The Consumer-visible brand with which the product/hardware would be is 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 parameters: The name of the industrial design.
7. Display screen parameters: A build ID string meant for displaying to the user
8. Fingerprint Unique ID: A String that uniquely identifies the 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 visible name of the end user: the end-user-visible name for the end product.
14. The name of the product as a whole: the overall product of the name.
15. RADIO Radio Firmware version: The RADIO firmware version number. Obsolete after API14. UsegetRadioVersion()代替。
16. SERIAL Hardware serial numbers: A hardware SERIAL number, if available. Alphanumeric only, case-insensitive.
17, tags Description of the build tag, such as unsigned, Debug and so on. : comma-separated tags describing the build, like "Unsigned,debug".
18. Time
19. Type build types: The type of build, like "user" or "eng".
20. USER
Vii. Public methods:
public static String getradioversion () gets the radio firmware version
Eight, test example:
PackageCom.home.build;Importandroid.app.Activity;ImportAndroid.os.Build;ImportAndroid.os.Bundle;ImportAndroid.widget.TextView; Public class mainactivity extends Activity { PrivateTextView Showtext; @Override protected voidOnCreate (Bundle savedinstancestate) { Super. OnCreate (Savedinstancestate); Setcontentview (R.layout.main); Showtext = (TextView) Findviewbyid (R.ID.MAIN_TV); Showtext.settext (Getdeviceinfo ()); } /** * Get device information * * @return * * PrivateString Getdeviceinfo () { StringBuffer SB =NewStringBuffer (); Sb.append ("Motherboard:"+ Build.board); Sb.append ("\ nthe system Boot program version number:"+ Build.bootloader); Sb.append ("\ n system customizer:"+ Build.brand); Sb.append ("\NCPU instruction set:"+ Build.cpu_abi); Sb.append ("\NCPU instruction set 2"+ Build.cpu_abi2); Sb.append ("\ n setting Parameters:"+ Build.device); Sb.append ("\ nthe display parameter:"+ Build.display); Sb.append ("\ n Radio firmware version:"+ build.getradioversion ()); Sb.append ("\ n Hardware ID:"+ Build.fingerprint); Sb.append ("\ n Hardware name:"+ Build.hardware); Sb.append ("\nhost:"+ build.host); Sb.append ("\ n Revision list:"+ build.id); Sb.append ("\ nthe hardware manufacturer:"+ Build.manufacturer); Sb.append ("\ n version:"+ Build.model); Sb.append ("\ n Hardware serial number:"+ build.serial); Sb.append ("\ nthe handset manufacturer:"+ build.product); Sb.append ("\ n describes the tag for build:"+ build.tags); Sb.append ("\ntime:"+ build.time); Sb.append ("\nbuilder type:"+ Build.type); Sb.append ("\nuser:"+ Build.user); returnSb.tostring (); }}
Android----Build Class