Get the API Level of the device

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)


Wow, I really need this extension, Thank you for making this extension Mrs.@Anke

1 Like

Nice extension!!

1 Like

(added to FAQ)


Simple but powerful.


Helpful extension! @Anke


I added get Android Version:

de.bodymindpower.GetApiLevel_2.aix (5.0 KB)


Wow. This is very useful, especially for now on android 10 and 11 changes.
Thank you, Anke!

1 Like

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...


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.

Done (version 3, Dec. 30, 2021):
GetApiLevel_3.aix (5.0 KB)

So, MIT needs to update the documentation. It identifies ios platform. :astonished: so this might be the future. :slight_smile:


and provides Android Version of the device it is running on. :slight_smile: