| 1 | http://code.google.com/p/android-python27/source/browse/python-build-with-qt/README |
| 2 | {{{ |
| 3 | # - Based on https://github.com/nonameentername/python-android modified for my needs |
| 4 | # - Tested on Ubuntu 11.04-i386 with Android NDK-6b and NDK-7c, gcc/g++ 4.4 and gcc/g++ 4.5 |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | # 1) Host machine dev env config if needed (package list for 32bit host, package names for 64bit may change) |
| 10 | # check installed package on host machine with: zcat -f /var/log/dpkg.log* | grep "\ install\ " | sort |
| 11 | |
| 12 | |
| 13 | sudo apt-get install build-essential cpp-4.4 g++-4.4 gcc-4.4-base gcc-4.4 bison flex autoconf automake autotools-dev quilt libcurl3 curl openssh-server ant mercurial filezilla pure-ftpd dpatch texinfo libncurses5-dev libgmp3-dev libmpfr-dev gawk patchutils binutils-dev zlib1g-dev |
| 14 | #sudo apt-get install git-core gnupg gperf libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | # 2) build python 2.7.2 for Android |
| 20 | |
| 21 | |
| 22 | export NDK="/home/tony/Desktop/xcross/android-ndk-r7c" |
| 23 | export SDK="/home/tony/Desktop/xcross/android-sdk-linux_x86/" |
| 24 | export NDKPLATFORM="$NDK/platforms/android-9/arch-arm" |
| 25 | export PATH="$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/:$NDK:$SDK/tools:$PATH" |
| 26 | |
| 27 | |
| 28 | bash bootstrap.sh && build_py.sh |
| 29 | Then navigate to the jni/python folder and uncomment all the commented lines in the Android.mk file |
| 30 | bash build_py.sh && package.sh |
| 31 | |
| 32 | |
| 33 | //////////////////////////////////////////////////// |
| 34 | /////////SIP and PYQT/////////////////////////////// |
| 35 | 1) Download Necessitas installer and set install location to /opt/necessitas/ |
| 36 | 2) Open Makefiles in both PyQt4 and sip folders and manually change all the paths that include (/home/tsheasha/......) to the corresponding path. |
| 37 | [This will be fixed soon to be done automatically by running a shell file] |
| 38 | 3) Navigate to sip folder from terminal and enter commands : (a) make -j6 (b) make install |
| 39 | 4) Navigate to PyQt4 folder from terminal and enter commands : (a) make -j6 (b) make install |
| 40 | 5) bash package_pyqt.sh |
| 41 | 6) Using the zipped folder output from the previous operation and packing your python project ina zipped folder as well named: "my_python_project.zip", you can run your applicaiton on Android phones using the a project, which is a joint product of this project apk and the Necessitas project. This project is provided in the directory PyDroid. |
| 42 | 7)All you need to do is place your zipped folders in the res/raw direstory of this project, update the python library paths on the .pro file and just run using the Necessitas QtCreator. A sample application is provided in the downloaded project. |
| 43 | //////////////////////////////////////////////////// |
| 44 | //////////////////////////////////////////////////// |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | ------- |
| 50 | |
| 51 | |
| 52 | ./bootstrap.sh |
| 53 | Downloads Python-2.7.2 source |
| 54 | patches Python for android |
| 55 | builds hostpython and hostpgen |
| 56 | |
| 57 | |
| 58 | ./build.sh |
| 59 | builds python library for android |
| 60 | |
| 61 | |
| 62 | ./package.sh |
| 63 | creates python_rxx.zip and python_extras_rxx.zip |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | current status: |
| 69 | Python build finished, but the necessary bits to build these modules were not found: |
| 70 | _bsddb _curses _curses_panel |
| 71 | _tkinter bsddb185 bz2 |
| 72 | dbm dl gdbm |
| 73 | imageop linuxaudiodev nis |
| 74 | ossaudiodev readline sunaudiodev |
| 75 | To find the necessary bits, look in setup.py in detect_modules() for the module's name. |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | Failed to build these modules: |
| 81 | _ctypes_test _locale audioop |
| 82 | grp spwd |
| 83 | }}} |