aboutsummaryrefslogtreecommitdiffhomepage
path: root/site
diff options
context:
space:
mode:
authorGravatar Lukacs Berki <lberki@google.com>2015-09-22 12:18:09 +0000
committerGravatar Laszlo Csomor <laszlocsomor@google.com>2015-09-22 17:07:52 +0000
commitf1b537ae1e8928a36929be72f2b7789e0807303c (patch)
tree61c564c97cda2d9090f9c20c4c6d024a119f8dbb /site
parent590767e9118a3709e49c44fb77130aa4203d0841 (diff)
Enhance the tutorial by adding information about setting up the Android NDK.
-- MOS_MIGRATED_REVID=103637048
Diffstat (limited to 'site')
-rw-r--r--site/docs/tutorial/android-app.md23
1 files changed, 22 insertions, 1 deletions
diff --git a/site/docs/tutorial/android-app.md b/site/docs/tutorial/android-app.md
index 252bf6d463..4b4a59dcbc 100644
--- a/site/docs/tutorial/android-app.md
+++ b/site/docs/tutorial/android-app.md
@@ -53,7 +53,7 @@ Bazel needs to run the Android SDK
[build tools](https://developer.android.com/tools/revisions/build-tools.html)
and uses the SDK libraries to build the app. This means that you need to add
some information to your `WORKSPACE` file so that Bazel knows where to find
-them. Note that this step is not required when you build all types of outputs.
+them. Note that this step is not required when you build for other platforms.
For example, Bazel automatically detects the location of Java, C++ and
Objective-C compilers from settings in your environment.
@@ -71,6 +71,27 @@ android_sdk_repository(
)
```
+If you want to compile native code into your Android app, you also need download
+the [Android NDK](https://developer.android.com/ndk/downloads/index.html) and
+tell Bazel where to find it by adding the following stanza to your `WORKSPACE`
+file:
+
+```python
+android_ndk_repository(
+ name = "androidndk",
+ # Replace with path to Android NDK on your system
+ path = "/Users/username/Library/Android/ndk",
+ # Replace with the Android NDK API level
+ api_level = 21
+)
+```
+
+"API level" is the version of the Android API the SDK and the NDK target
+(for example, 19 for Android K and 21 for Android L). It's not necessary to set
+the API levels to the same value for the SDK and NDK.
+[This web page](https://developer.android.com/ndk/guides/stable_apis.html)
+contains a map from Android releases to NDK-supported API levels.
+
## Create a BUILD file
A [`BUILD` file](/docs/build-ref.html#BUILD_files) is a text file that describes