2
2
Build options
3
3
=============
4
4
5
- This page contains instructions for using some of the specific python-for-android build options.
5
+ This page contains instructions for using different build options.
6
6
7
7
8
- Python version
9
- --------------
10
-
11
- python-for-android now supports building APKs with either python2 or
12
- python3, but these have extra requirements or potential disadvantages
13
- as below.
14
-
8
+ Python versions
9
+ ---------------
15
10
16
11
python2
17
12
~~~~~~~
@@ -52,25 +47,19 @@ there may be bugs or surprising behaviours. If you come across any,
52
47
feel free to `open an issue
53
48
<https://github.com/kivy/python-for-android> `__.
54
49
55
- As this build is experimental, some features are missing and
56
- the build is not fully optimised so APKs are probably a little larger
57
- and slower than they need to be. This is currently being addressed,
58
- though it's not clear how the final result will compare to python2.
59
-
60
50
.. _bootstrap_build_options :
61
51
62
- Bootstrap
63
- ---------
52
+ Bootstrap options
53
+ -----------------
64
54
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.
55
+ python-for-android supports multiple app backends with different types
56
+ of interface. These are called *bootstraps *.
68
57
69
58
Currently the following bootstraps are supported, but we hope that it
70
59
it should be easy to add others if your project has different
71
60
requirements. `Let us know
72
- <https://groups.google.com/forum/#!forum/python-android> `__ if there
73
- are any improvements that would help here .
61
+ <https://groups.google.com/forum/#!forum/python-android> `__ if you'd
62
+ like help adding a new one .
74
63
75
64
sdl2
76
65
~~~~
@@ -89,6 +78,45 @@ and have them work with this bootstrap. It should also be possible to
89
78
use e.g. pygame_sdl2, but this would need a build recipe and doesn't
90
79
yet have one.
91
80
81
+ Build options
82
+ %%%%%%%%%%%%%
83
+
84
+ The sdl2 bootstrap supports the following additional command line
85
+ options (this list may not be exhaustive):
86
+
87
+ - ``--private ``: The directory containing your project files.
88
+ - ``--package ``: The Java package name for your project. Choose e.g. ``org.example.yourapp ``.
89
+ - ``--name ``: The app name.
90
+ - ``--version ``: The version number.
91
+ - ``--orientation ``: One of ``portait ``, ``landscape `` or ``sensor ``
92
+ to automatically rotate according to the device orientation.
93
+ - ``--icon ``: A path to the png file to use as the application icon.
94
+ - ``-- permission ``: A permission name for the app,
95
+ e.g. ``--permission VIBRATE ``. For multiple permissions, add
96
+ multiple ``--permission `` arguments.
97
+ - ``--meta-data ``: Custom key=value pairs to add in the application metadata.
98
+ - ``--presplash ``: A path to the image file to use as a screen while
99
+ the application is loading.
100
+ - ``--presplash-color ``: The presplash screen background color, of the
101
+ form ``#RRGGBB `` or a color name ``red ``, ``green ``, ``blue `` etc.
102
+ - ``--wakelock ``: If the argument is included, the application will
103
+ prevent the device from sleeping.
104
+ - ``--window ``: If the argument is included, the application will not
105
+ cover the Android status bar.
106
+ - ``--blacklist ``: The path to a file containing blacklisted patterns
107
+ that will be excluded from the final APK. Defaults to ``./blacklist.txt ``.
108
+ - ``--whitelist ``: The path to a file containing whitelisted patterns
109
+ that will be included in the APK even if also blacklisted.
110
+ - ``--add-jar ``: The path to a .jar file to include in the APK. To
111
+ include multiple jar files, pass this argument multiple times.
112
+ - ``--intent-filters ``: A file path containing intent filter xml to be
113
+ included in AndroidManifest.xml.
114
+ - ``--service ``: A service name and the Python script it should
115
+ run. See :ref: `arbitrary_scripts_services `.
116
+ - ``--add-source ``: Add a source directory to the app's Java code.
117
+ - ``--no-compile-pyo ``: Do not optimise .py files to .pyo.
118
+
119
+
92
120
webview
93
121
~~~~~~~
94
122
@@ -112,6 +140,39 @@ present (e.g. during the short Python loading time when first
112
140
started), it will instead display a loading screen until the server is
113
141
ready.
114
142
143
+ - ``--private ``: The directory containing your project files.
144
+ - ``--package ``: The Java package name for your project. Choose e.g. ``org.example.yourapp ``.
145
+ - ``--name ``: The app name.
146
+ - ``--version ``: The version number.
147
+ - ``--orientation ``: One of ``portait ``, ``landscape `` or ``sensor ``
148
+ to automatically rotate according to the device orientation.
149
+ - ``--icon ``: A path to the png file to use as the application icon.
150
+ - ``-- permission ``: A permission name for the app,
151
+ e.g. ``--permission VIBRATE ``. For multiple permissions, add
152
+ multiple ``--permission `` arguments.
153
+ - ``--meta-data ``: Custom key=value pairs to add in the application metadata.
154
+ - ``--presplash ``: A path to the image file to use as a screen while
155
+ the application is loading.
156
+ - ``--presplash-color ``: The presplash screen background color, of the
157
+ form ``#RRGGBB `` or a color name ``red ``, ``green ``, ``blue `` etc.
158
+ - ``--wakelock ``: If the argument is included, the application will
159
+ prevent the device from sleeping.
160
+ - ``--window ``: If the argument is included, the application will not
161
+ cover the Android status bar.
162
+ - ``--blacklist ``: The path to a file containing blacklisted patterns
163
+ that will be excluded from the final APK. Defaults to ``./blacklist.txt ``.
164
+ - ``--whitelist ``: The path to a file containing whitelisted patterns
165
+ that will be included in the APK even if also blacklisted.
166
+ - ``--add-jar ``: The path to a .jar file to include in the APK. To
167
+ include multiple jar files, pass this argument multiple times.
168
+ - ``--intent-filters ``: A file path containing intent filter xml to be
169
+ included in AndroidManifest.xml.
170
+ - ``--service ``: A service name and the Python script it should
171
+ run. See :ref: `arbitrary_scripts_services `.
172
+ - ``add-source ``: Add a source directory to the app's Java code.
173
+ - ``--port ``: The port on localhost that the WebView will
174
+ access. Defaults to 5000.
175
+
115
176
116
177
pygame
117
178
~~~~~~
@@ -126,3 +187,45 @@ apps, but hasn't been developed with this in mind.
126
187
This bootstrap will eventually be deprecated in favour of sdl2, but
127
188
not before the sdl2 bootstrap includes all the features that would be
128
189
lost.
190
+
191
+ Build options
192
+ %%%%%%%%%%%%%
193
+
194
+ The pygame bootstrap supports the following additional command line
195
+ options (this list may not be exhaustive):
196
+
197
+ - ``--private ``: The directory containing your project files.
198
+ - ``--dir ``: The directory containing your project files if you want
199
+ them to be unpacked to the external storage directory rather than
200
+ the app private directory.
201
+ - ``--package ``: The Java package name for your project. Choose e.g. ``org.example.yourapp ``.
202
+ - ``--name ``: The app name.
203
+ - ``--version ``: The version number.
204
+ - ``--orientation ``: One of ``portait ``, ``landscape `` or ``sensor ``
205
+ to automatically rotate according to the device orientation.
206
+ - ``--icon ``: A path to the png file to use as the application icon.
207
+ - ``--ignore-path ``: A path to ignore when including the app
208
+ files. Pass multiple times to ignore multiple paths.
209
+ - ``-- permission ``: A permission name for the app,
210
+ e.g. ``--permission VIBRATE ``. For multiple permissions, add
211
+ multiple ``--permission `` arguments.
212
+ - ``--meta-data ``: Custom key=value pairs to add in the application metadata.
213
+ - ``--presplash ``: A path to the image file to use as a screen while
214
+ the application is loading.
215
+ - ``--wakelock ``: If the argument is included, the application will
216
+ prevent the device from sleeping.
217
+ - ``--window ``: If the argument is included, the application will not
218
+ cover the Android status bar.
219
+ - ``--blacklist ``: The path to a file containing blacklisted patterns
220
+ that will be excluded from the final APK. Defaults to ``./blacklist.txt ``.
221
+ - ``--whitelist ``: The path to a file containing whitelisted patterns
222
+ that will be included in the APK even if also blacklisted.
223
+ - ``--add-jar ``: The path to a .jar file to include in the APK. To
224
+ include multiple jar files, pass this argument multiple times.
225
+ - ``--intent-filters ``: A file path containing intent filter xml to be
226
+ included in AndroidManifest.xml.
227
+ - ``--service ``: A service name and the Python script it should
228
+ run. See :ref: `arbitrary_scripts_services `.
229
+ - ``add-source ``: Add a source directory to the app's Java code.
230
+ - ``--compile-pyo ``: Optimise .py files to .pyo.
231
+ - ``--resource ``: A key=value pair to add in the string.xml resource file.
0 commit comments