I've got a native interface with two reasons I need to have the device's SDK level. The first is that some methods were deprecated and so I need to determine if the device has a high enough version for the new API, and the second is that a new permission is required for SDK level 23 but adding that permission on devices with
I've tried statements like this below, but I don't think it's working:
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR2)
I've also tried the above with just the integer representing the level, such as 18 for JELLY_BEAN_MR2. Is there an AndroidNativeUtil for this? I can't find any documentation about what classes are in AndroidNativeUtil.
The reason I don't think it's working is that when I add these statements to control which API is used, the app works OK on a newer device with the higher API level, but hangs on a device with the older API level. I'm assuming that it must always think the API > 18.