Skip to content

Build Info

levching edited this page Apr 14, 2020 · 4 revisions

With the AN_Build class, you can get information about the current build, extracted from system properties. See the example below:

using SA.Android.OS;
...

//The base OS build the product is based on.
Debug.Log("AN_Build.VERSION.BASE_OS: " + AN_Build.VERSION.BASE_OS);

//The current development codename, or the string "REL" if this is a release build.
Debug.Log("AN_Build.VERSION.CODENAME: " + AN_Build.VERSION.CODENAME);

//The internal value used by the underlying source control to represent this build.
Debug.Log("AN_Build.VERSION.INCREMENTAL " + AN_Build.VERSION.INCREMENTAL);

//The developer preview revision of a prerelease SDK.
Debug.Log("AN_Build.VERSION.PREVIEW_SDK_INT: " + AN_Build.VERSION.PREVIEW_SDK_INT);

//The user-visible version string.
Debug.Log("AN_Build.VERSION.RELEASE: " + AN_Build.VERSION.RELEASE);

//The SDK version of the software currently running on this hardware device.
Debug.Log("AN_Build.VERSION.SDK_INT: " + AN_Build.VERSION.SDK_INT);

//The user-visible security patch level.
Debug.Log("AN_Build.VERSION.SECURITY_PATCH: " + AN_Build.VERSION.SECURITY_PATCH);

The most common use case of AN_Build class is to check the current device API level. See the simple example below how you can do it using Android Native Pro:

using SA.Android.OS;
...

if (AN_Build.VERSION.SDK_INT >= AN_Build.VERSION_CODES.O) {
    //Current system runs android 8.0 oreo (api 26)
}
Clone this wiki locally