Skip to content

Most visited

Recently visited




public final class AndroidThings
extends Object


AndroidThings library information. This library lives on the device and is linked at runtime to the app, so it may be a different version than what the app was compiled against. This class provides a way to query the version of the library installed on the device and used at runtime.


Public methods

static int getVersionMajor()

Gets the major version number.

static int getVersionMinor()

Gets the minor version number.

static int getVersionRevision()

Gets the version revision number.

static String getVersionString()

Returns the full library version as a string.

static String getVersionTag()

Gets the version tag.

Inherited methods

From class java.lang.Object

Public methods


int getVersionMajor ()

Gets the major version number. A major version bump indicates additional APIs have been added, but the library will still be backwards-compatible with previous major API versions.

int The major library version number.


int getVersionMinor ()

Gets the minor version number. A minor version bump indicates internal changes such as bugfixes or other improvements. No additional APIs will be added but some behavior may change.

int The minor library version number.


int getVersionRevision ()

Gets the version revision number. A non-zero revision number indicates a special sub-releases made for a specific purpose. These releases should typically only be used for their designated purpose, as they may introduce test APIs and behaviors (similar to getVersionTag()).

int The library version revision number.


String getVersionString ()

Returns the full library version as a string. Includes the major and minor versions and the tag. The string format may change between library versions; use the individual component accessors instead for programmatic version checks.

String The library version string.


String getVersionTag ()

Gets the version tag. A tag provides additional information about the library. Tags will be an empty string on stable releases; if non-empty then the library may contain test APIs or behaviors.

String The library version tag.
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields


Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)