This repository is in alpha development. forked from Py4A on GoogleCode
see Releases page, and select an installer: PythonForAndroid-debug.apk .
This is Python built to run on Android devices. It is made to be used together with SL4A (Scripting Layer For Android).
Nearly all the actual non-python specific documentation can be found at android-scripting
For Python specific issues and enhancements only, please use the issues tab.
- python2: an Android Device 1.6 >=
- python3: an Android Device 2.3.1 >=
- internet access
- SL4A was installed.
- Download SL4A Application, such as sl4a-r6.1.1-arm-debug.apk
- Download Py4A Application, such as PythonForAndroid-debug.apk
- Enable "Unknown Sources" in your device settings.
- Open 1. apk to install. (sl4a)
- Open 2. apk to install. (py4a)
- Open PythonForAndroid application
- Click Install to download and install python binaries.
- Launch sl4a, Select 'Menu' >> 'View' >> 'Interpreters' and Select 'Python 2.7.?'.
- Python will be launched, have fun!
- if you device is not connected to internet, please try this way.
- Download sl4a apk
- Download py4a apk
- Download py4a zips, interpreter - python_r26.zip, modules - python_extras_r26.zip, sample scripts - python_scripts_r26.zip.
- Enable "Unknown Sources" in your device settings.
- Open 1. apk to install. (sl4a)
- Open 2. apk to install. (py4a)
- Open PythonForAndroid application
- push 3. zips to device's /sdcard/com.googlecode.pythonforandroid. (be sure /sdcard path to fit your device.)
- Click "Local install" to check zips and install python binaries.
- Launch sl4a, Select 'Menu' >> 'View' >> 'Interpreters' and Select 'Python 2.7.?'.
- Python will be launched, have fun!
Current issue form is here::
* What device(s) are you experiencing the problem on?
* ex: Nexus ???
* What OS version are you running on the device?
* ex: Andriod ???
* What version of the product are you using?
* SL4A r????
* PythonForAndroid r??
* What steps will reproduce the problem?
1.
2.
3.
* What is the expected output%3F What do you see instead?
* expected: launch ???
* see: stop running
* Please provide any additional information below.
- Examples as cookbooks.
- Modules
- fullscreenwrapper2
- Versions
- BuildingModules
- BuildingPython
- Python3
- Show all articles
Please do not ask any question about below!
- No relatations: Py4A python2.7
- No relatations: QPython
- No relatations: Kivy
- In order to build Py4A you first need to build python for Android platform, make sure you have all the dependencies needed for building python 2.7 for your distro in Ubuntu run: sudo apt-get build-dep python2.7
- Android NDK >= r10d
- Android SDK >= 21.1.2
- Gradle >= 2.0 (included in Android Studio >= 1.0.2)
- Clone this project.
for Mercurial uesr (with hg-git plugin)
$ hg clone git://github.com/kuri65536/python-for-android
for git user
$ git clone git://github.com/kuri65536/python-for-android
- Build the apk:
$ cd android/PythonForAndroid
$ echo sdk.dir=/path/to/android-sdk > local.properties
$ sh /path/to/android-stdudio/gradle/gradle-2.2.1/bin/gradle assembleDebug
Building ??% ...
$ ls build/outputs/apk/
PythonForAndroid-debug.apk
- Build the py4a binaries.
$ cd python-build
$ NDK_PATH=/path/to/android-ndk-r10d make build
$ ls python*.zip
python_r18.zip python_extra_r18.zip ... and so on...
- Confirm your binary version.
$ cd python-build
$ cat LATEST_VERSION
r17
$ cat LATEST_VERSION_EXTRA
r17
$ cat LATEST_VERSION_SCRIPTS
r17
- Make a release in github and Upload the binaries to it. Please be careful to match the release name and confirmed binary versions.
- Requirements: root is required.
- Requirements: python already install.
- Requirements: unzip is needed for extract.
How to run:
- after build, move current directory to python2:
cd python-build
- run scripts
$ sd=/sdcard adb=~/install/android-sdk-linux/platform-tools/adb \
sh ../tools/localinstall.sh