@@ -10,7 +10,7 @@ options available.
1010.. warning :: These instructions are quite preliminary. The
1111 installation and use process will become more standard in
1212 the near future.
13-
13+
1414
1515Installation
1616------------
@@ -20,18 +20,18 @@ The easiest way to install is with pip. You need to have setuptools installed, t
2020 pip install git+https://github.com/kivy/python-for-android.git
2121
2222This should install python-for-android (though you may need to run as root or add --user).
23-
23+
2424You could also install python-for-android manually, either via git::
2525
2626 git clone https://github.com/kivy/python-for-android.git
2727 cd python-for-android
28-
28+
2929Or by direct download::
3030
3131 wget https://github.com/kivy/python-for-android/archive/master.zip
3232 unzip revamp.zip
3333 cd python-for-android-revamp
34-
34+
3535Then in both cases run ``python setup.py install ``.
3636
3737Dependencies
@@ -58,13 +58,13 @@ install most of these with::
5858 sudo dpkg --add-architecture i386
5959 sudo apt-get update
6060 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+
6262When installing the Android SDK and NDK, note the filepaths where they
6363may be found, and the version of the NDK installed. You may need to
6464set environment variables pointing to these later.
6565
6666.. _basic_use :
67-
67+
6868Basic use
6969---------
7070
@@ -84,7 +84,7 @@ Android SDK and NDK, then:
8484- Set the ``ANDROIDSDK `` env var to the ``/path/to/the/sdk ``
8585- Set the ``ANDROIDNDK `` env var to the ``/path/to/the/ndk ``
8686- 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 ``).
8888- Set the ``ANDROIDNDKVER `` env var to the version of the NDK
8989 downloaded, e.g. the current NDK is ``r10e `` (or leave it unset to
9090 use the default of ``r9 ``.
@@ -97,41 +97,41 @@ To create a basic distribution, run .e.g::
9797
9898 python-for-android create --dist_name=testproject --bootstrap=pygame \
9999 --requirements=sdl,python2
100-
100+
101101This will compile the distribution, which will take a few minutes, but
102102will keep you informed about its progress. The arguments relate to the
103103properties of the created distribution; the dist_name is an (optional)
104104unique identifier, and the requirements is a list of any pure Python
105105pypi modules, or dependencies with recipes available, that your app
106106depends on. The full list of builtin internal recipes can be seen with
107107``python-for-android recipes ``.
108-
108+
109109.. note :: Compiled dists are not located in the same place as with old
110110 python-for-android, but instead in an OS-dependent
111111 location. The build process will print this location when it
112112 finishes, but you no longer need to navigate there manually
113113 (see below).
114-
114+
115115To build an APK, use the ``apk `` command::
116116
117117 python-for-android apk --private /path/to/your/app --package=org.example.packagename \
118118 --name="Your app name" --version=0.1
119-
119+
120120The arguments to ``apk `` can be anything accepted by the old
121121python-for-android build.py; the above is a minimal set to create a
122122basic app. You can see the list with ``python-for-android apk help ``.
123123
124124A new feature of python-for-android is that you can do all of this with just one command::
125125
126126 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
128128 --bootstrap=pygame --requirements=sdl,python2 --dist_name=testproject
129-
129+
130130This combines the previous ``apk `` command with the arguments to
131131``create ``, and works in exactly the same way; if no internal
132132distribution exists with these requirements then one is first built,
133133before 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.
135135
136136Using this method you don't have to worry about whether a dist exists,
137137though 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:
183183 python-for-android automatically checks the default buildozer
184184 download directory. This is intended to make testing
185185 python-for-android easy.
186-
186+
187187If none of these is set, python-for-android will raise an error and exit.
188-
188+
189189The Android API to target
190190~~~~~~~~~~~~~~~~~~~~~~~~~
191191
@@ -209,7 +209,7 @@ several ways. Each choice overrides all the later ones:
209209- The ``--android_api `` argument to any python-for-android command.
210210- The ``ANDROIDAPI `` environment variables.
211211- If neither of the above, the default target is used (currently 14).
212-
212+
213213python-for-android checks if the target you select is available, and
214214gives an error if not, so it's easy to test if you passed this
215215variable correctly.
@@ -250,3 +250,15 @@ and means that you probably do *not* have to manually set this.
250250If ``RELEASE.TXT `` exists but you manually set a different version,
251251python-for-android will warn you about it, but will assume you are
252252correct 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