[issue28740] Add sys.getandroidapilevel()

Xavier de Gaye report at bugs.python.org
Sat Nov 19 08:13:36 EST 2016


Xavier de Gaye added the comment:

__system_property_get() is not a public API, see Android bug report [1].

In this stackoverflow question, an Android developer confirms this point and suggests to use the file /system/build.prop instead, noting however that "build.prop isn't guaranteed to be stable (or even present)".

This interesting document [3] describes the Android properties management design.

I think we must use the reliable build time Android API level and implement sys.getandroidapilevel() (Victor patch) for knowing, in the standard library, whether we are running on an Android platform, and provide a best effort platform.android_ver() for the Android run time version. Things are changing very fast with the Android project and the OEM may add their own changes too.

[1] https://code.google.com/p/android/issues/detail?id=143627
[2] http://stackoverflow.com/questions/28413530/api-to-get-android-system-properties-is-removed-in-arm64-platforms
[3] http://rxwen.blogspot.fr/2010/01/android-property-system.html

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28740>
_______________________________________


More information about the Python-bugs-list mailing list