Android APK starter template for the PyDevices product stack: python-for-android recipes and a Buildozer app (p4a_app/) you can clone and customize with your own code.
Testing without building an APK: If you just want to run scripts or test applications on an Android device or emulator from the terminal, use
pydevices/bin/android.pywithadb. You do not need to build your own APK.
On Android, PyDevices applications run under CPython in a python-for-android APK using the SDL2 bootstrap (no Kivy). Runtime packages install from TestPyPI as CPython wheels. Pure-Python usdl2 and the MCU-shaped board_config come from pydevices-desktop; p4a’s sdl2 recipe supplies libSDL2.so.
./build_android.sh -y
./scripts/emulator.shFull prerequisites, icon/presplash, emulator/phone setup, and sdkmanager notes: docs/building.md.
| File / Folder | Role |
|---|---|
p4a_app/main.py |
Your Python application entrypoint |
p4a_app/buildozer.spec |
Buildozer configuration (app title, package ID, icon, permissions) |
p4a_app/icon.png |
App launcher icon + presplash screen |
p4a_recipes/ |
TestPyPI / PyPI PyProjectRecipe build recipes |
build_android.sh |
Build the debug APK |
scripts/ |
Host emulator/device launcher helpers |
- Modify
p4a_app/main.pywith your PyDevices logic and UI code. - Edit
p4a_app/buildozer.specto customizetitle,package.name, andpackage.domain. - Replace
p4a_app/icon.pngwith your app's icon. - Run
./build_android.shto generate your.apk.