Giter Site home page Giter Site logo

maxi119 / python-for-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from r1chardj0n3s/python-for-android

0.0 1.0 0.0 10.3 MB

Turn your python application to an Android APK - Build your own python and extension

Home Page: http://python-for-android.rtfd.org

License: GNU Lesser General Public License v2.1

python-for-android's Introduction

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
  1. Launch "android", and download latest Android platform, here API 14, which would be Android 4.0

  2. Export some environment variables:

    export ANDROIDSDK="/path/to/android/android-sdk-linux_86"
    export ANDROIDNDK="/path/to/android/android-ndk-r8c"
    export ANDROIDNDKVER=r8c
    export ANDROIDAPI=14
    
(Of course correct the paths mentioned in ANDROIDSDK and ANDROIDNDK)
  1. Clone python-for-android:

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

    cd python-for-android
    ./distribute.sh -m "openssl pil kivy"
    
  3. 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
    
  4. Install the debug apk to your device:

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

Build Configuration File

You may end up with a very long build.py command-line invocation so to make things easier you can store the arguments in a configuration file like so:

package=net.mechanicalcat.match3
name=Match 3
version=1.3.3
numeric-version=133
dir=~/src/projects/games/match3
orientation=portrait
icon=~/src/projects/games/match3/art/android-icon.png
presplash=~/src/projects/games/match3/art/android-presplash.jpg
blacklist=blacklist.txt
sdk=14

and then use the configuration file as your only build argument:

python build.py -c match3_build.ini release

The parameters in the configuration file match the names in the command-line arguments. List parameters (permission, ignore_path) may have multiple items on new lines:

permission=VIBRATE
INTERNET

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

python-for-android's People

Contributors

tito avatar tshirtman avatar r1chardj0n3s avatar thopiekar avatar akshayaurora avatar bertonha avatar nklever avatar legikaloz avatar brousch avatar bgola avatar artagnon avatar bbigras avatar dustinlacewell avatar hartym avatar hansent avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.