Python 3.13+platformfunction
platform.android_ver()
specific operating systems
Android device details: release, api_level, manufacturer, model, device, is_emulator; the defaults outside Android.
Syntax
platform.android_ver(release='', api_level=0, manufacturer='', model='', device='', is_emulator=False)
The call is safe on any OS: outside Android every string is empty, api_level is 0 and is_emulator is False. api_level is the API level of the device the code runs on; the level Python was built for comes from sys.getandroidapilevel(). On Android platform.system() answers 'Android' even though the kernel is Linux.
Examples
import platform
info = platform.android_ver()
print(type(info.api_level).__name__) # → int
print(info.api_level) # → ? вне Android 0
See also
Open in the full glossarydocs.python.orgReport an inaccuracy