@@ -10,7 +10,7 @@ options available.
10
10
.. warning :: These instructions are quite preliminary. The
11
11
installation and use process will become more standard in
12
12
the near future.
13
-
13
+
14
14
15
15
Installation
16
16
------------
@@ -20,18 +20,18 @@ The easiest way to install is with pip. You need to have setuptools installed, t
20
20
pip install git+https://github.com/kivy/python-for-android.git
21
21
22
22
This should install python-for-android (though you may need to run as root or add --user).
23
-
23
+
24
24
You could also install python-for-android manually, either via git::
25
25
26
26
git clone https://github.com/kivy/python-for-android.git
27
27
cd python-for-android
28
-
28
+
29
29
Or by direct download::
30
30
31
31
wget https://github.com/kivy/python-for-android/archive/master.zip
32
32
unzip revamp.zip
33
33
cd python-for-android-revamp
34
-
34
+
35
35
Then in both cases run ``python setup.py install ``.
36
36
37
37
Dependencies
@@ -58,13 +58,13 @@ install most of these with::
58
58
sudo dpkg --add-architecture i386
59
59
sudo apt-get update
60
60
sudo apt-get install -y build-essential ccache git zlib1g-dev python2.7 python2.7-dev libncurses5:i386 libstdc++6:i386 zlib1g:i386 openjdk-7-jdk unzip ant
61
-
61
+
62
62
When installing the Android SDK and NDK, note the filepaths where they
63
63
may be found, and the version of the NDK installed. You may need to
64
64
set environment variables pointing to these later.
65
65
66
66
.. _basic_use :
67
-
67
+
68
68
Basic use
69
69
---------
70
70
@@ -84,7 +84,7 @@ Android SDK and NDK, then:
84
84
- Set the ``ANDROIDSDK `` env var to the ``/path/to/the/sdk ``
85
85
- Set the ``ANDROIDNDK `` env var to the ``/path/to/the/ndk ``
86
86
- Set the ``ANDROIDAPI `` to the targeted API version (or leave it
87
- unset to use the default of ``14 ``).
87
+ unset to use the default of ``14 ``).
88
88
- Set the ``ANDROIDNDKVER `` env var to the version of the NDK
89
89
downloaded, e.g. the current NDK is ``r10e `` (or leave it unset to
90
90
use the default of ``r9 ``.
@@ -97,41 +97,41 @@ To create a basic distribution, run .e.g::
97
97
98
98
python-for-android create --dist_name=testproject --bootstrap=pygame \
99
99
--requirements=sdl,python2
100
-
100
+
101
101
This will compile the distribution, which will take a few minutes, but
102
102
will keep you informed about its progress. The arguments relate to the
103
103
properties of the created distribution; the dist_name is an (optional)
104
104
unique identifier, and the requirements is a list of any pure Python
105
105
pypi modules, or dependencies with recipes available, that your app
106
106
depends on. The full list of builtin internal recipes can be seen with
107
107
``python-for-android recipes ``.
108
-
108
+
109
109
.. note :: Compiled dists are not located in the same place as with old
110
110
python-for-android, but instead in an OS-dependent
111
111
location. The build process will print this location when it
112
112
finishes, but you no longer need to navigate there manually
113
113
(see below).
114
-
114
+
115
115
To build an APK, use the ``apk `` command::
116
116
117
117
python-for-android apk --private /path/to/your/app --package=org.example.packagename \
118
118
--name="Your app name" --version=0.1
119
-
119
+
120
120
The arguments to ``apk `` can be anything accepted by the old
121
121
python-for-android build.py; the above is a minimal set to create a
122
122
basic app. You can see the list with ``python-for-android apk help ``.
123
123
124
124
A new feature of python-for-android is that you can do all of this with just one command::
125
125
126
126
python-for-android apk --private /path/to/your/app \
127
- --package=org.example.packagename --name="Your app name" --version=0.5
127
+ --package=org.example.packagename --name="Your app name" --version=0.5
128
128
--bootstrap=pygame --requirements=sdl,python2 --dist_name=testproject
129
-
129
+
130
130
This combines the previous ``apk `` command with the arguments to
131
131
``create ``, and works in exactly the same way; if no internal
132
132
distribution exists with these requirements then one is first built,
133
133
before being used to package the APK. When the command is run again,
134
- the build step is skipped and the previous dist re-used.
134
+ the build step is skipped and the previous dist re-used.
135
135
136
136
Using this method you don't have to worry about whether a dist exists,
137
137
though it is recommended to use a different ``dist_name `` for each
@@ -183,9 +183,9 @@ order; setting any of these variables overrides all the later ones:
183
183
python-for-android automatically checks the default buildozer
184
184
download directory. This is intended to make testing
185
185
python-for-android easy.
186
-
186
+
187
187
If none of these is set, python-for-android will raise an error and exit.
188
-
188
+
189
189
The Android API to target
190
190
~~~~~~~~~~~~~~~~~~~~~~~~~
191
191
@@ -209,7 +209,7 @@ several ways. Each choice overrides all the later ones:
209
209
- The ``--android_api `` argument to any python-for-android command.
210
210
- The ``ANDROIDAPI `` environment variables.
211
211
- If neither of the above, the default target is used (currently 14).
212
-
212
+
213
213
python-for-android checks if the target you select is available, and
214
214
gives an error if not, so it's easy to test if you passed this
215
215
variable correctly.
@@ -250,3 +250,15 @@ and means that you probably do *not* have to manually set this.
250
250
If ``RELEASE.TXT `` exists but you manually set a different version,
251
251
python-for-android will warn you about it, but will assume you are
252
252
correct and try to continue the build.
253
+
254
+ Configuration file
255
+ ~~~~~~~~~~~~~~~~~~
256
+
257
+ python-for-android look on the current directory if there is a `.p4a `
258
+ configuration file. If it found it, it adds all the lines as options
259
+ to the command line. For example, you can put the options you would
260
+ always write such as:
261
+
262
+ --dist_name my_example
263
+ --android_api 19
264
+ --requirements kivy,openssl
0 commit comments