Jorge M A Well-Known Member Licensed User Longtime User Apr 27, 2019 #1 Hello Everyone! What is the best practice to get SDK number, considering permissions, library size, performance, etc.? Reflector or Phone? B4X: 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 B4X: Sub GetSDK() As Int Dim p As Phone Return p.SdkVersion End Sub (both snippets taken somewhere the forum) Thank you!
Hello Everyone! What is the best practice to get SDK number, considering permissions, library size, performance, etc.? Reflector or Phone? B4X: 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 B4X: Sub GetSDK() As Int Dim p As Phone Return p.SdkVersion End Sub (both snippets taken somewhere the forum) Thank you!
agraham Expert Licensed User Longtime User Apr 27, 2019 #2 They are both essentially the same code as Phone does this B4X: public static int getSdkVersion() { return Build.VERSION.SDK_INT; } I would just use Phone. Upvote 0
They are both essentially the same code as Phone does this B4X: public static int getSdkVersion() { return Build.VERSION.SDK_INT; } I would just use Phone.