public class PreviewSdk extends Object
Apps must be very careful when targeting preview builds because binary compatibility
is not guaranteed. APIs can be renamed or drastically changed before they are finalized
into a new API level. The new SDK constant Build.VERSION.PREVIEW_SDK_INT
marks a precise snapshot version of prerelease API.
isKnownPreviewDevice()
will return true
if the current device
is running a preview build with the same SDK snapshot this support lib was built with.
If it returns true
it is safe to call prerelease APIs. If not, the app
should fall back to only assuming the presence of the latest public, final API level.
Constructor and Description |
---|
PreviewSdk() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isKnownPreviewDevice()
Check if the current device is running a prerelease platform preview build matching
the SDK this library was built for.
|
public static boolean isKnownPreviewDevice()