This is an extension to get the API level of the device from the Android version that is currently running.
de.bodymindpower.GetApiLevel.aix (4.8 KB)
That's all:
Update (Dec. 30, 2021, ver 3):
GetApiLevel_3.aix (5.0 KB)
This is an extension to get the API level of the device from the Android version that is currently running.
de.bodymindpower.GetApiLevel.aix (4.8 KB)
That's all:
Update (Dec. 30, 2021, ver 3):
GetApiLevel_3.aix (5.0 KB)
Nice extension!!
(added to FAQ)
Simple but powerful.
Wow. This is very useful, especially for now on android 10 and 11 changes.
Thank you, Anke!
Am I understanding this correctly .. using AI Companion Do It on the "getAndroidVersion" block returns a value in quotes, designating that it is a string and not a numeric value? That's fine with me, I just want to know how to use the value when its returned..
@Anke might want to update the extension and follow the naming conventions..
rather than getAndroidVersion the property could be renamed to just AndroidVersion
App Inventor does not distinguish between strings and numeric values... just use it as you like to use it... just give it a try...
Taifun
You do not have to use an extension. The Screen on nb188 has the following Blocks:
Platform gets the name of the underlying platform running the app. Currently, this is the text “Android”. Other platforms may be supported in the future.
PlatformVersion gets the version number of the platform running the app. This is typically a dotted version number, such as 10.0. Any value can be returned, however, so you should take care to handle unexpected data. If the platform version is unavailable, the empty text will be returned.
So, MIT needs to update the documentation. It identifies ios platform. so this might be the future.
and provides Android Version of the device it is running on.
Dear Anke,
thank you very much for your invaluable help proving the GetApiLevel_3.aix. After a lot of troubles, it was the only worked for me ...