Skip to content
Turn your Python application into an Android APK - build your own python and extensions https://python-for-android.readthedocs.org
Python Java C Makefile Shell HTML Other
Pull request Compare This branch is 4 commits ahead, 1258 commits behind master.
Latest commit 99f7ae1 @tito tito added a jni.pxi by copy/paste from the jni.h + update android.pyx to …
…pass cython! (not tested.)

README.rst

Python for Android

Python for android is a project to create your own Python distribution including the modules you want, and create an apk including python, libs, and your application.

Global overview

  1. Download Android NDK, SDK

  2. Launch "android", and download latest Android platform

  3. Export some environment variables:

    export ANDROIDSDK="/path/to/android/android-sdk-linux_86"
    export ANDROIDNDK="/path/to/android/android-ndk-r7"
    export ANDROIDNDKVER=r7
    export ANDROIDAPI=14
    
  4. Clone python-for-android:

    git clone git://github.com/kivy/python-for-android
    
  5. Build a distribution with OpenSSL module, PIL and Kivy:

    cd python-for-android
    ./distribute.sh -m "openssl pil kivy"
    
  6. Go to your fresh distribution, build the APK of your application:

    cd dist/default
    ./build.py --package org.test.touchtracer --name touchtracer \
    --version 1.0 --dir ~/code/kivy/examples/demo/touchtracer debug
    
  7. Install the debug apk to your device:

    adb install bin/touchtracer-1.0-debug.apk
    
  8. Enjoy.

Troubleshooting

if you get the following message:

Android NDK: Host 'awk' tool is outdated. Please define HOST_AWK to point to Gawk or Nawk !

a solution is to remove the "awk" binary in the android ndk distribution

rm $ANDROIDNDK/prebuilt/linux-x86/bin/awk
Something went wrong with that request. Please try again.