Python 3.13+platformterm
platform.AndroidVer
specific operating systems
The result type of platform.android_ver(): a six-field named tuple from release to is_emulator.
Syntax
platform.AndroidVer(release, api_level, manufacturer, model, device, is_emulator)
The fields have mixed types: api_level is an integer, is_emulator a bool, the rest strings, so comparing api_level with '34' is pointless. The class has no documentation entry of its own: android_ver() defines the contract, and the class itself is mostly useful for isinstance and annotations.
Examples
import platform
print(platform.AndroidVer._fields) # → ('release', 'api_level', 'manufacturer', 'model', 'device', 'is_emulator')
info = platform.AndroidVer('14', 34, 'Google', 'Pixel 8', 'shiba', False)
print(info.api_level >= 33) # → True
See also
Open in the full glossarydocs.python.orgReport an inaccuracy