2
2
Build options
3
3
=============
4
4
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.
8
6
9
7
10
8
Python version
@@ -20,9 +18,9 @@ python2
20
18
21
19
Select this by adding it in your requirements, e.g. ``--requirements=python2 ``.
22
20
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.
26
24
27
25
The python2 build is also the way python-for-android originally
28
26
worked, even in the old toolchain.
@@ -35,23 +33,26 @@ python3
35
33
Python3 support is experimental, and some of these details
36
34
may change as it is improved and fully stabilised.
37
35
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
+
38
40
Select this by adding the ``python3crystax `` recipe to your
39
41
requirements, e.g. ``--requirements=python3crystax ``.
40
42
41
43
This uses the prebuilt Python from the `CrystaX NDK
42
44
<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
44
46
*must * use the CrystaX NDK 10.3.0 or higher when building with
45
47
python3. You can get it `here
46
48
<https://www.crystax.net/en/download> `__.
47
49
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
52
53
<https://github.com/kivy/python-for-android> `__.
53
54
54
- The experimental status also means that some features are missing and
55
+ As this build is experimental, some features are missing and
55
56
the build is not fully optimised so APKs are probably a little larger
56
57
and slower than they need to be. This is currently being addressed,
57
58
though 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.
61
62
Bootstrap
62
63
---------
63
64
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.
67
68
68
69
Currently the following bootstraps are supported, but we hope that it
69
70
it should be easy to add others if your project has different
@@ -74,30 +75,25 @@ are any improvements that would help here.
74
75
sdl2
75
76
~~~~
76
77
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 ``.
79
80
80
81
SDL2 is a popular cross-platform depelopment library, particularly for
81
82
games. It has its own Android project support, which
82
83
python-for-android uses as a bootstrap, and to which it adds the
83
84
Python build and JNI code to start it.
84
85
85
86
From 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
87
88
and have them work with this bootstrap. It should also be possible to
88
89
use e.g. pygame_sdl2, but this would need a build recipe and doesn't
89
90
yet have one.
90
91
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
-
96
92
webview
97
93
~~~~~~~
98
94
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 ``.
101
97
102
98
The webview bootstrap gui is, per the name, a WebView displaying a
103
99
webpage, but this page is hosted on the device via a Python
0 commit comments