Freigeben über


Build.VERSION.PreviewSdkInt Property

Definition

The developer preview revision of a prerelease SDK.

[Android.Runtime.Register("PREVIEW_SDK_INT", ApiSince=23)]
public static int PreviewSdkInt { get; }
[<Android.Runtime.Register("PREVIEW_SDK_INT", ApiSince=23)>]
static member PreviewSdkInt : int

Property Value

Attributes

Remarks

The developer preview revision of a prerelease SDK. This value will always be 0 on production platform builds/devices.

When this value is nonzero, any new API added since the last officially published #SDK_INT API level is only guaranteed to be present on that specific preview revision. For example, an API Activity.fooBar() might be present in preview revision 1 but renamed or removed entirely in preview revision 2, which may cause an app attempting to call it to crash at runtime.

Experimental apps targeting preview APIs should check this value for equality (==) with the preview SDK revision they were built for before using any prerelease platform APIs. Apps that detect a preview SDK revision other than the specific one they expect should fall back to using APIs from the previously published API level only to avoid unwanted runtime exceptions.

Java documentation for android.os.Build.VERSION.PREVIEW_SDK_INT.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to