Android Question [Answered] What Is Best Practice to Get SDK Number?

Jorge M A

Well-Known Member
Licensed User
Hello Everyone!

What is the best practice to get SDK number, considering permissions, library size, performance, etc.?
Reflector or Phone?

Sub SDKVersion As Int
    Dim r As Reflector
    Dim ver As Int
    ver = r.GetStaticField("android.os.Build$VERSION", "SDK_INT")
    Return ver
End Sub

Sub GetSDK() As Int
    Dim p As Phone
    Return p.SdkVersion
End Sub

(both snippets taken somewhere the forum)

Thank you!