I'm developing an android application and want to support android Q Beta. So I tried android Q beta on my pixel 1.
But, when I want to check specific SDK version, it showing incorrect number.
I have read this and for android Q, SDK_INT should be 10000 (because it will similar with constant_value CUR_DEVELOPMENT).
I tried debugging to get SDK_INT number with this code :
CustomLog.v("Build", "build int : " + Build.VERSION.SDK_INT + " | Curr Dev : " + Build.VERSION_CODES.CUR_DEVELOPMENT + " | Build baseOS: " + Build.VERSION.BASE_OS);
CustomLog.v("Build", "preview sdk int : " + Build.VERSION.PREVIEW_SDK_INT + " | Code Nanme : " + Build.VERSION.CODENAME + " | Version Q : " + Build.VERSION_CODES.Q);
I expect the output Build.VERSION.SDK_INT to be 10000, but the actual output is 28, which is constant_value for android P.
This is the log in my logcat:
and this is information the devices:
That's normal - and it is gonna be this way until Q is officially released I guess. If you want to test against Q you could use
BuildCompat#isAtLeastQ()
As point out by CommonsWare
, The real value (29) should start appearing around Q Beta 4 when the APIs are supposed to be finalized.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With