updated android/osx project and example project structure

This commit is contained in:
Joseph Henry
2016-06-23 11:36:08 -07:00
parent ee54905035
commit 6e16aad79c
158 changed files with 530 additions and 16 deletions

View File

@@ -16,7 +16,7 @@ In this example we aim to set up a minimal [Android Studio](https://developer.an
**Step 2: Build Shared Library**
- `make android_jni_lib`
- The resultant `build/android_jni_lib_YOUR_ARCH/libZeroTierOneJNI.so` is what you want to import into your own project to provide the API to your app. Select your architecture and copy the shared library into `YourProject/src/main/jniLibs/YOUR_ARCH/`. Selecting only the architectures you need will *significantly* reduce overall build time.
- The resultant `build/android_jni_lib_YOUR_ARCH/libZeroTierOneJNI.so` is what you want to import into your own project to provide the API to your app. Select your architecture and copy the shared library into your project's JNI directory, possibly `/src/main/jniLibs/YOUR_ARCH/`. Selecting only the architectures you need will *significantly* reduce overall build time.
**Step 3: App Code Modifications**
- Create new package called `ZeroTierSDK` in your project and add a new file called `ZeroTierSDK.java` containing:

View File

@@ -2,8 +2,8 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
ZTSDK := ../../../../src
ZT := ../../../../zerotierone
ZTSDK := ../../../../../src
ZT := ../../../../../zerotierone
LOCAL_MODULE := ZeroTierOneJNI
LOCAL_C_INCLUDES := $(ZT1)/include

View File

@@ -4,5 +4,11 @@ APP_CPPFLAGS := -O3 -DUSE_SOCKS_PROXY -DZT_SDK -fPIC -fPIE -fvectorize -Wall -fs
APP_PLATFORM := android-14
# Architectures
APP_ABI := all
#APP_ABI := armeabi-v7a
# APP_ABI := all
#APP_ABI += arm64-v8a
#APP_ABI += armeabi
APP_ABI += armeabi-v7a
#APP_ABI += mips
#APP_ABI += mips64
#APP_ABI += x86
#APP_ABI += x86_64

View File

@@ -31,7 +31,7 @@ android {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
commandLine "${android.getNdkDirectory().getAbsolutePath()}/ndk-build.cmd", '-j8', '-C', file('../../java').absolutePath, "ZT1=${System.getProperty('user.dir')}/../../../../zerotierone"
} else {
commandLine "${android.getNdkDirectory().getAbsolutePath()}/ndk-build", '-j8', '-C', file('../../java').absolutePath, "ZT1=${System.getProperty('user.dir')}/../../../zerotierone"
commandLine "${android.getNdkDirectory().getAbsolutePath()}/ndk-build", '-j8', '-C', file('../../java').absolutePath, "ZT1=${System.getProperty('user.dir')}/../../../../zerotierone"
}
}
tasks.withType(JavaCompile) {

View File

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

Before

Width:  |  Height:  |  Size: 689 B

After

Width:  |  Height:  |  Size: 689 B

View File

Before

Width:  |  Height:  |  Size: 624 B

After

Width:  |  Height:  |  Size: 624 B

Some files were not shown because too many files have changed in this diff Show More