22Build options
33=============
44
5- python-for-android provides several major choices for build
6- components. This page describes the advantages and drawbacks, and
7- extra technical details or requirements, in each case.
5+ This page contains instructions for using some of the specific python-for-android build options.
86
97
108Python version
@@ -20,9 +18,9 @@ python2
2018
2119Select this by adding it in your requirements, e.g. ``--requirements=python2 ``.
2220
23- This option builds Python 2.7.2 for your selected Android architecture, and
24- includes it in the APK . There are no special requirements, all the
25- building is done locally.
21+ This option builds Python 2.7.2 for your selected Android
22+ architecture . There are no special requirements, all the building is
23+ done locally.
2624
2725The python2 build is also the way python-for-android originally
2826worked, even in the old toolchain.
@@ -35,23 +33,26 @@ python3
3533 Python3 support is experimental, and some of these details
3634 may change as it is improved and fully stabilised.
3735
36+ .. note :: You must manually download the `CrystaX NDK
37+ <https://www.crystax.net/android/ndk>`__ and tell
38+ python-for-android to use it with ``--ndk-dir /path/to/NDK ``.
39+
3840Select this by adding the ``python3crystax `` recipe to your
3941requirements, e.g. ``--requirements=python3crystax ``.
4042
4143This uses the prebuilt Python from the `CrystaX NDK
4244<https://www.crystax.net/android/ndk> `__, a drop-in replacement for
43- Google's official NDK which includes many improvements. As such, you
45+ Google's official NDK which includes many improvements. You
4446*must * use the CrystaX NDK 10.3.0 or higher when building with
4547python3. You can get it `here
4648<https://www.crystax.net/en/download> `__.
4749
48- python3 inclusion should work fine, including all existing
49- recipes, but internally this is handled quite differently to the
50- locally built python2 so there may be bugs or surprising
51- behaviours. If you come across any, feel free to `open an issue
50+ The python3crystax build is is handled quite differently to python2 so
51+ there may be bugs or surprising behaviours. If you come across any,
52+ feel free to `open an issue
5253<https://github.com/kivy/python-for-android> `__.
5354
54- The experimental status also means that some features are missing and
55+ As this build is experimental, some features are missing and
5556the build is not fully optimised so APKs are probably a little larger
5657and slower than they need to be. This is currently being addressed,
5758though it's not clear how the final result will compare to python2.
@@ -61,9 +62,9 @@ though it's not clear how the final result will compare to python2.
6162Bootstrap
6263---------
6364
64- python-for-android supports multiple bootstraps, the Java and JNI code
65- that starts the app and the python interpreter, then handles
66- interactions with the Android OS.
65+ python-for-android supports multiple bootstraps, which contain the app
66+ backend that starts the app and the python interpreter, then
67+ handles interactions with the Android OS.
6768
6869Currently the following bootstraps are supported, but we hope that it
6970it should be easy to add others if your project has different
@@ -74,30 +75,25 @@ are any improvements that would help here.
7475sdl2
7576~~~~
7677
77- You can use this with ``--bootstrap=sdl2 ``, or simply include the
78- ``sdl2 `` recipe in your ``--requirements ``.
78+ Use this with ``--bootstrap=sdl2 ``, or just include the
79+ ``sdl2 `` recipe, e.g. ``--requirements=sdl2,python2 ``.
7980
8081SDL2 is a popular cross-platform depelopment library, particularly for
8182games. It has its own Android project support, which
8283python-for-android uses as a bootstrap, and to which it adds the
8384Python build and JNI code to start it.
8485
8586From the point of view of a Python program, SDL2 should behave as
86- normal. For instance, you can build apps with Kivy, Vispy, or PySDL2
87+ normal. For instance, you can build apps with Kivy or PySDL2
8788and have them work with this bootstrap. It should also be possible to
8889use e.g. pygame_sdl2, but this would need a build recipe and doesn't
8990yet have one.
9091
91- .. note ::
92- The SDL2 bootstrap is newer, and does not support all the old
93- features of the Pygame one. It is under active development to fix
94- these omissions.
95-
9692webview
9793~~~~~~~
9894
99- You can use this with ``--bootstrap=webview ``, or simply include the
100- ``webviewjni `` recipe in your ``--requirements ``.
95+ You can use this with ``--bootstrap=webview ``, or include the
96+ ``webviewjni `` recipe, e.g. ``--requirements=webviewjni,python2 ``.
10197
10298The webview bootstrap gui is, per the name, a WebView displaying a
10399webpage, but this page is hosted on the device via a Python
0 commit comments