# Print output for @column tags ?> Build - Android SDK | Android Developers

Most visited

Recently visited

Build

public class Build
extends Object

java.lang.Object
   ↳ android.os.Build


Information about the current build, extracted from system properties.

Summary

Nested classes

class Build.Partition

Build information for a particular device partition. 

class Build.VERSION

Various version strings. 

class Build.VERSION_CODES

Enumeration of the currently known SDK version codes. 

Constants

String UNKNOWN

Value used for when a build property is unknown.

Fields

public static final String BOARD

The name of the underlying board, like "goldfish".

public static final String BOOTLOADER

The system bootloader version number.

public static final String BRAND

The consumer-visible brand with which the product/hardware will be associated, if any.

public static final String CPU_ABI

This field is deprecated. Use SUPPORTED_ABIS instead.

public static final String CPU_ABI2

This field is deprecated. Use SUPPORTED_ABIS instead.

public static final String DEVICE

The name of the industrial design.

public static final String DISPLAY

A build ID string meant for displaying to the user

public static final String FINGERPRINT

A string that uniquely identifies this build.

public static final String HARDWARE

The name of the hardware (from the kernel command line or /proc).

public static final String HOST

public static final String ID

Either a changelist number, or a label like "M4-rc20".

public static final String MANUFACTURER

The manufacturer of the product/hardware.

public static final String MODEL

The end-user-visible name for the end product.

public static final String PRODUCT

The name of the overall product.

public static final String RADIO

This field is deprecated. The radio firmware version is frequently not available when this class is initialized, leading to a blank or "unknown" value for this string. Use getRadioVersion() instead.

public static final String SERIAL

This field is deprecated. Use getSerial() instead.

public static final String[] SUPPORTED_32_BIT_ABIS

An ordered list of 32 bit ABIs supported by this device.

public static final String[] SUPPORTED_64_BIT_ABIS

An ordered list of 64 bit ABIs supported by this device.

public static final String[] SUPPORTED_ABIS

An ordered list of ABIs supported by this device.

public static final String TAGS

Comma-separated tags describing the build, like "unsigned,debug".

public static final long TIME

The time at which the build was produced, given in milliseconds since the UNIX epoch.

public static final String TYPE

The type of build, like "user" or "eng".

public static final String USER

Public constructors

Build()

Public methods

static List<Build.Partition> getFingerprintedPartitions()

Get build information about partitions that have a separate fingerprint defined.

static String getRadioVersion()

Returns the version string for the radio firmware.

static String getSerial()

Gets the hardware serial number, if available.

Inherited methods

Constants

UNKNOWN

public static final String UNKNOWN

Value used for when a build property is unknown.

Constant Value: "unknown"

Fields

BOARD

public static final String BOARD

The name of the underlying board, like "goldfish".

BOOTLOADER

public static final String BOOTLOADER

The system bootloader version number.

BRAND

public static final String BRAND

The consumer-visible brand with which the product/hardware will be associated, if any.

CPU_ABI

public static final String CPU_ABI

This field is deprecated.
Use SUPPORTED_ABIS instead.

The name of the instruction set (CPU type + ABI convention) of native code.

CPU_ABI2

public static final String CPU_ABI2

This field is deprecated.
Use SUPPORTED_ABIS instead.

The name of the second instruction set (CPU type + ABI convention) of native code.

DEVICE

public static final String DEVICE

The name of the industrial design.

DISPLAY

public static final String DISPLAY

A build ID string meant for displaying to the user

FINGERPRINT

public static final String FINGERPRINT

A string that uniquely identifies this build. Do not attempt to parse this value.

HARDWARE

public static final String HARDWARE

The name of the hardware (from the kernel command line or /proc).

HOST

public static final String HOST

ID

public static final String ID

Either a changelist number, or a label like "M4-rc20".

MANUFACTURER

public static final String MANUFACTURER

The manufacturer of the product/hardware.

MODEL

public static final String MODEL

The end-user-visible name for the end product.

PRODUCT

public static final String PRODUCT

The name of the overall product.

RADIO

public static final String RADIO

This field is deprecated.
The radio firmware version is frequently not available when this class is initialized, leading to a blank or "unknown" value for this string. Use getRadioVersion() instead.

The radio firmware version number.

SERIAL

public static final String SERIAL

This field is deprecated.
Use getSerial() instead.

A hardware serial number, if available. Alphanumeric only, case-insensitive. This field is always set to Build#UNKNOWN.

SUPPORTED_32_BIT_ABIS

public static final String[] SUPPORTED_32_BIT_ABIS

An ordered list of 32 bit ABIs supported by this device. The most preferred ABI is the first element in the list. See SUPPORTED_ABIS and SUPPORTED_64_BIT_ABIS.

SUPPORTED_64_BIT_ABIS

public static final String[] SUPPORTED_64_BIT_ABIS

An ordered list of 64 bit ABIs supported by this device. The most preferred ABI is the first element in the list. See SUPPORTED_ABIS and SUPPORTED_32_BIT_ABIS.

SUPPORTED_ABIS

public static final String[] SUPPORTED_ABIS

An ordered list of ABIs supported by this device. The most preferred ABI is the first element in the list. See SUPPORTED_32_BIT_ABIS and SUPPORTED_64_BIT_ABIS.

TAGS

public static final String TAGS

Comma-separated tags describing the build, like "unsigned,debug".

TIME

public static final long TIME

The time at which the build was produced, given in milliseconds since the UNIX epoch.

TYPE

public static final String TYPE

The type of build, like "user" or "eng".

USER

public static final String USER

Public constructors

Build

public Build ()

Public methods

getFingerprintedPartitions

public static List<Build.Partition> getFingerprintedPartitions ()

Get build information about partitions that have a separate fingerprint defined. The list includes partitions that are suitable candidates for over-the-air updates. This is not an exhaustive list of partitions on the device.

Returns
List<Build.Partition> This value cannot be null.

getRadioVersion

public static String getRadioVersion ()

Returns the version string for the radio firmware. May return null (if, for instance, the radio is not currently on).

Returns
String

getSerial

public static String getSerial ()

Gets the hardware serial number, if available.

Note: Root access may allow you to modify device identifiers, such as the hardware serial number. If you change these identifiers, you can use key attestation to obtain proof of the device's original identifiers.

Starting with API level 29, persistent device identifiers are guarded behind additional restrictions, and apps are recommended to use resettable identifiers (see Best practices for unique identifiers). This method can be invoked if one of the following requirements is met:

  • If the calling app has been granted the READ_PRIVILEGED_PHONE_STATE permission; this is a privileged permission that can only be granted to apps preloaded on the device.
  • If the calling app is the device or profile owner and has been granted the Manifest.permission#READ_PHONE_STATE permission. The profile owner is an app that owns a managed profile on the device; for more details see Work profiles. Profile owner access is deprecated and will be removed in a future release.
  • If the calling app has carrier privileges (see TelephonyManager.hasCarrierPrivileges()) on any active subscription.
  • If the calling app is the default SMS role holder (see RoleManager.isRoleHeld(String)).

If the calling app does not meet one of these requirements then this method will behave as follows:

  • If the calling app's target SDK is API level 28 or lower and the app has the READ_PHONE_STATE permission then Build#UNKNOWN is returned.
  • If the calling app's target SDK is API level 28 or lower and the app does not have the READ_PHONE_STATE permission, or if the calling app is targeting API level 29 or higher, then a SecurityException is thrown.

Requires android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE

Returns
String The serial number if specified.