Android Question Build.VERSION.RELEASE

touchsquid

Active Member
Licensed User
Longtime User
4.4.2, 4.4.3 and 4.4.4 all return SDK = 19 so that does not help.
 
Upvote 0

touchsquid

Active Member
Licensed User
Longtime User
I found the answer. Using OS Library this code works:

Sub OSVersion As String
Dim os As OperatingSystem
Return os.Release
End Sub
 
Upvote 0

designer2k2

Member
Licensed User
Longtime User
Its ab it old, but you just need the reflection lib:

B4X:
Dim r As Reflector
    Dim Api As Int
    Dim sApi As String
       Api = r.GetStaticField("android.os.Build$VERSION", "SDK_INT")
    sApi = r.GetStaticField("android.os.Build$VERSION", "RELEASE")
    If Api >= 23 Then
        Log("Api is above 23")
        If sApi = "6.0.1" Then
            Log("Its a 6.0.1 device")
        End If
    End If

this adds no permissions, and just 4kb in size.
 
Upvote 0
Top