Android Question How to tell if a device is running Android 10 or greater?

Robert Valentino

Well-Known Member
Licensed User
Longtime User
Is there anyway to tell if a device is running Android 10 or greater?

I was going to use
B4X:
Dim OSVersion            As String      =    mReflector.GetStaticField("android.os.Build$VERSION", "RELEASE")

But according to the Docs:
The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas". This field is an opaque string. Do not assume that its value has any particular structure or that values of RELEASE from different releases can be somehow ordered.

So I cannot user it to compare to 10 or higher. There must be a version number somewhere that is actually a number?
Or do we just look for a SDK number greater then something?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…