python-for-android is a toolchain that compiles Python applications and their dependencies into installable Android APK or AAB packages. It bundles a Python interpreter and standard library into an Android package, enabling Python code to run natively on mobile devices. The project provides a recipe-based build engine that automates dependency resolution, version pinning, and custom compilation steps for Android targets.
The system cross-compiles Python and native C-extension libraries for multiple Android CPU architectures, producing separate native binaries for each target and packaging them into a single APK or AAB. It supports multiple UI frameworks through a pluggable backend layer, allowing applications to be packaged with Kivy, PySDL2, or a WebView-based interface. The build process compiles Python bytecode and C extensions into native shared libraries, then combines them with Android manifest resources into a signed distribution package.
The project includes a recipe system for defining build steps with dependency declarations, enabling automatic cross-compilation of libraries like NumPy and SQLAlchemy. It handles multi-architecture builds to ensure compatibility across a wide range of Android devices. Documentation is available through the project's site.