About this project

python-for-android (p4a) is an open-source development tool maintained by the Kivy team that packages Python applications into native Android binaries. It works by cross-compiling the Python interpreter and its dependencies for Android devices, then bundling them with the app's Python code so that the code is interpreted on the device itself. The tool can generate three types of Android artifacts: APK files for local installation and testing (used by many app stores but not Google Play), AAB (Android App Bundle) files for distribution on Google Play Store, and AAR (Android Archive) files that serve as reusable resource bundles for other projects. It supports multiple CPU architectures. While it is closely associated with the Kivy framework, p4a is designed to be flexible about backend libraries through its "bootstraps" system. It also supports PySDL2, PySDL3, and a WebView backend with a Python web server. For pure Python packages, dependencies are handled automatically. For packages with C code dependencies, a special "recipe" must be written to support cross-compilation; p4a ships with built-in recipes for many popular libraries such as numpy and sqlalchemy. The project recommends using p4a via Buildozer, which ensures correct dependencies are pre-installed and centralizes configuration, though p4a can also be used independently. It is available on PyPI and has comprehensive online documentation including a quickstart guide. The project is actively maintained with CI/CD workflows for unit testing, app building, and Docker image generation, and it follows a Contributor Covenant code of conduct.