diff --git a/.gitignore b/.gitignore index 7213ff5..a8954fb 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ # Android Studio *.idea *.gradle +integrations/android/android_jni_lib/proj/local.properties # Unity *.meta diff --git a/docs/android_zt_sdk.md b/docs/android_zt_sdk.md index 8b9b102..9aacb9a 100644 --- a/docs/android_zt_sdk.md +++ b/docs/android_zt_sdk.md @@ -5,13 +5,18 @@ Welcome! Imagine a flat, encrypted, no-configuration LAN for all of the instances of your Android app. This short tutorial will show you how to enable ZeroTier functionality for your Android app with little to no code modification. Check out our [ZeroTier SDK](https://www.zerotier.com/blog) page for more info on how the integration works. In this example we aim to set up a minimal [Android Studio](https://developer.android.com/studio/index.html) project which contains all of the components necessary to enable ZeroTier for your app. -*NOTE: For Android JNI libraries to build you'll need to install [Android Studio](https://developer.android.com/studio/index.html) the [Android NDK](https://developer.android.com/ndk/index.html). Currently only Android NDK r10e is supported and can be found [here for OSX](http://dl.google.com/android/repository/android-ndk-r10e-darwin-x86_64.zip) and [here for Linux](http://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip). You'll need to tell our project where you put it by putting the path in [this file](android/proj/local.properties), you'll need to install the Android Build-Tools (this can typically be done through the editor the first time you start it up), and finally you should probably upgrade your Gradle plugin if it asks you to. If you don't have these things installed and configured we will detect that and just skip those builds automatically.* +*NOTE: For Android JNI libraries to build you'll need to install [Android Studio](https://developer.android.com/studio/index.html) the [Android NDK](https://developer.android.com/ndk/index.html). Currently only Android NDK r10e is supported and can be found [here for OSX](http://dl.google.com/android/repository/android-ndk-r10e-darwin-x86_64.zip) and [here for Linux](http://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip). You'll need to tell our project where you put it by putting the path in [this file](android_jni_lib/proj/local.properties), you'll need to install the Android Build-Tools (this can typically be done through the editor the first time you start it up), and finally you should probably upgrade your Gradle plugin if it asks you to. If you don't have these things installed and configured we will detect that and just skip those builds automatically.* -If you want to skip these steps and just take a look at the project, go [here](example_app). +If you want to skip the following steps and just take a look at the project, go [here](example_app). *** -**Step 1: Select build targets** +**Step 1: Select build targets and evironment paths** - Specify the target architectures you want to build in [Application.mk](android/java/jni/Application.mk). By default it will build `arm64-v8a`, `armeabi`, `armeabi-v7a`, `mips`, `mips64`, `x86`, and `x86_64`. + - Specify your SDK/NDK path in `android_jni_lib/proj/local.properties`. For example: + ``` + sdk.dir=/Users/Joseph/Library/Android/sdk + ndk.dir=/Users/Joseph/Library/Android/ndk-r10e + ``` **Step 2: Build Shared Library** - `make android_jni_lib` diff --git a/integrations/android/README.md b/integrations/android/README.md index 8b9b102..9aacb9a 100644 --- a/integrations/android/README.md +++ b/integrations/android/README.md @@ -5,13 +5,18 @@ Welcome! Imagine a flat, encrypted, no-configuration LAN for all of the instances of your Android app. This short tutorial will show you how to enable ZeroTier functionality for your Android app with little to no code modification. Check out our [ZeroTier SDK](https://www.zerotier.com/blog) page for more info on how the integration works. In this example we aim to set up a minimal [Android Studio](https://developer.android.com/studio/index.html) project which contains all of the components necessary to enable ZeroTier for your app. -*NOTE: For Android JNI libraries to build you'll need to install [Android Studio](https://developer.android.com/studio/index.html) the [Android NDK](https://developer.android.com/ndk/index.html). Currently only Android NDK r10e is supported and can be found [here for OSX](http://dl.google.com/android/repository/android-ndk-r10e-darwin-x86_64.zip) and [here for Linux](http://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip). You'll need to tell our project where you put it by putting the path in [this file](android/proj/local.properties), you'll need to install the Android Build-Tools (this can typically be done through the editor the first time you start it up), and finally you should probably upgrade your Gradle plugin if it asks you to. If you don't have these things installed and configured we will detect that and just skip those builds automatically.* +*NOTE: For Android JNI libraries to build you'll need to install [Android Studio](https://developer.android.com/studio/index.html) the [Android NDK](https://developer.android.com/ndk/index.html). Currently only Android NDK r10e is supported and can be found [here for OSX](http://dl.google.com/android/repository/android-ndk-r10e-darwin-x86_64.zip) and [here for Linux](http://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip). You'll need to tell our project where you put it by putting the path in [this file](android_jni_lib/proj/local.properties), you'll need to install the Android Build-Tools (this can typically be done through the editor the first time you start it up), and finally you should probably upgrade your Gradle plugin if it asks you to. If you don't have these things installed and configured we will detect that and just skip those builds automatically.* -If you want to skip these steps and just take a look at the project, go [here](example_app). +If you want to skip the following steps and just take a look at the project, go [here](example_app). *** -**Step 1: Select build targets** +**Step 1: Select build targets and evironment paths** - Specify the target architectures you want to build in [Application.mk](android/java/jni/Application.mk). By default it will build `arm64-v8a`, `armeabi`, `armeabi-v7a`, `mips`, `mips64`, `x86`, and `x86_64`. + - Specify your SDK/NDK path in `android_jni_lib/proj/local.properties`. For example: + ``` + sdk.dir=/Users/Joseph/Library/Android/sdk + ndk.dir=/Users/Joseph/Library/Android/ndk-r10e + ``` **Step 2: Build Shared Library** - `make android_jni_lib`