AndroidVersionImpl

internal class AndroidVersionImpl : Version

AndroidVersionImpl class provides the implementation of the Version interface. This class retrieves version-related information of the Android operating system from the Build.VERSION class, including base OS, SDK version, release information, incremental version, security patch level, and more. It handles different versions of Android using appropriate API levels.

This class makes use of the @RequiresApi annotations to indicate which Android API levels are required for accessing certain properties of the Build.VERSION.

Author

Swapnil Musale

See also

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
@get:RequiresApi(value = 23)
open override val baseOs: String

baseOs returns the base operating system version of the Android device

Link copied to clipboard
open override val codeName: String

codeName returns the code name of the current Android version (e.g., "Pie", "Q", "R")

Link copied to clipboard
open override val incremental: String

incremental returns the incremental version string for minor updates of the current Android version

Link copied to clipboard
@get:RequiresApi(value = 31)
open override val mediaPerformanceClass: Int

mediaPerformanceClass returns the media performance class of the Android device

Link copied to clipboard
@get:RequiresApi(value = 23)
open override val previewSdkInt: Int

previewSdkInt returns the SDK version for preview releases of Android

Link copied to clipboard
open override val release: String

release returns the release version of the Android operating system as a string

Link copied to clipboard
@get:RequiresApi(value = 30)
open override val releaseOrCodeName: String

releaseOrCodeName returns either the release version or the code name of the Android version

Link copied to clipboard
@get:RequiresApi(value = 33)
open override val releaseOrPreviewDisplay: String

releaseOrPreviewDisplay returns either the release version or the preview display name if the device is in preview mode

Link copied to clipboard
open override val sdkInt: Int

sdkInt returns the integer value of the current Android SDK version

Link copied to clipboard
@get:RequiresApi(value = 23)
open override val securityPatch: String

securityPatch returns the security patch level of the current Android version