Skip to content

Commit 86d9d46

Browse files
committed
Added Android SDK and NDK var setting info
1 parent f146d80 commit 86d9d46

File tree

1 file changed

+94
-4
lines changed

1 file changed

+94
-4
lines changed

doc/source/quickstart.rst

Lines changed: 94 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ install all many of these with::
5757
sudo apt-get update
5858
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
5959
60-
When installing
60+
When installing the Android SDK and NDK, note the filepaths where they
61+
may be found, and the version of the NDK installed. You may need to
62+
set environment variables pointing to these later.
63+
64+
.. _basic_use:
6165

6266
Basic use
6367
---------
@@ -78,13 +82,14 @@ Android SDK and NDK, then:
7882
- Set the ``ANDROIDSDK`` env var to the ``/path/to/the/sdk``
7983
- Set the ``ANDROIDNDK`` env var to the ``/path/to/the/ndk``
8084
- Set the ``ANDROIDAPI`` to the targeted API version (or leave it
81-
unset to use the default of ``14``).
85+
unset to use the default of ``14``).
8286
- Set the ``ANDROIDNDKVER`` env var to the version of the NDK
8387
downloaded, e.g. the current NDK is ``r10e`` (or leave it unset to
8488
use the default of ``r9``.
8589

86-
The process of setting these variables will be streamlined in the
87-
future, these options are preliminary.
90+
This is **NOT** the only way to set these variables, see the `setting
91+
SDK/NDK paths <setting_paths_>`_ section for other options and their
92+
details.
8893

8994
To create a basic distribution, run .e.g::
9095

@@ -145,3 +150,88 @@ step.
145150

146151
See the :doc:`commands` documentation for full details of available
147152
functionality.
153+
154+
.. _setting_paths:
155+
156+
Setting paths to the the SDK and NDK
157+
------------------------------------
158+
159+
If building your own dists it is necessary to have installed the
160+
Android SDK and NDK, and to make Kivy aware of their locations. The
161+
instructions in `basic use <basic_use_>`_ use environment variables
162+
for this, but this is not the only option. The different possibilities
163+
for each setting are given below.
164+
165+
Path to the Android SDK
166+
~~~~~~~~~~~~~~~~~~~~~~~
167+
168+
python-for-android searches in the following places for this path, in
169+
order; setting any of these variables overrides all the later ones:
170+
171+
- The ``--sdk_path`` argument to any python-for-android command.
172+
- The ``ANDROIDSDK`` environment variable.
173+
- The ``ANDROID_HOME`` environment variable (this may be used or set
174+
by other tools).
175+
176+
If none of these is set, python-for-android will raise an error and exit.
177+
178+
The Android API to target
179+
~~~~~~~~~~~~~~~~~~~~~~~~~
180+
181+
When building for Android it is necessary to target an API number
182+
corresponding to a specific version of Android. Whatever you choose,
183+
your APK will probably not work in earlier versions, but you also
184+
cannot use features introduced in later versions.
185+
186+
You must download specific platform tools for the SDK for any given
187+
target, it does not come with any. Do this by running
188+
``/path/to/android/sdk/tools/android``, which will give a gui
189+
interface, and select the 'platform tools' option under your chosen
190+
target.
191+
192+
The default target of python-for-android is 14, corresponding to
193+
Android 4.0. This may be changed in the near future.
194+
195+
You must pass the target API to python-for-android, and can do this in
196+
several ways. Each choice overrides all the later ones:
197+
198+
- The ``-android_api`` argument to any python-for-android command.
199+
- The ``ANDROIDAPI`` environment variables.
200+
- If neither of the above, the default target is used (currently 14).
201+
202+
python-for-android checks if the target you select is available, and
203+
gives an error if not, so it's easy to test if you passed this
204+
variable correctly.
205+
206+
Path to the Android NDK
207+
~~~~~~~~~~~~~~~~~~~~~~~
208+
209+
python-for-android searches in the following places for this path, in
210+
order; setting any of these variables overrides all the later ones:
211+
212+
- The ``--ndk_path`` argument to any python-for-android command.
213+
- The ``ANDROIDNDK`` environment variable.
214+
- The ``NDK_HOME`` environment variable (this may be used or set
215+
by other tools).
216+
- The ``ANDROID_NDK_HOME`` environment variable (this may be used or set
217+
by other tools).
218+
219+
If none of these is set, python-for-android will raise an error and exit.
220+
221+
The Android NDK version
222+
~~~~~~~~~~~~~~~~~~~~~~~
223+
224+
python-for-android needs to know what version of the NDK is installed,
225+
in order to properly resolve its internal filepaths. You can set this
226+
with any of the following methods - note that the first is preferred,
227+
and means that you probably do *not* have to manually set this.
228+
229+
- The ``RELEASE.TXT`` file in the NDK directory. If this exists and
230+
contains the version (which it probably does automatically), you do
231+
not need to set it manually.
232+
- The ``--ndk_ver`` argument to any python-for-android command.
233+
- The ``ANDROIDNDKVER`` environment variable.
234+
235+
If ``RELEASE.TXT`` exists but you manually set a different version,
236+
python-for-android will warn you about it, but will assume you are
237+
correct and try to continue the build.

0 commit comments

Comments
 (0)