Android----Build Class

Source: Internet
Author: User

First, class structure:


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:;;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:"+;    Sb.append ("\ n Revision list:"+;    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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.