The Android SDK has a lot of bugs and is failing to compile :( The github commits messed up versions so the Android.mk and build.xml have conflicting dependancies.
Any chance a kind soul can compile the whole Android SDK and upload the library to Maven/Gradle? Also provide a zipped folder of the built jni libs. Would appreciate it a lot.
Edit: Latest error after fixing a bunch of other errors -
BUILD FAILED
/Users/zod/libzt/zto/java/build.xml:52: Warning: Could not find file /Users/zod/libzt/zto/java/libs/armeabi/libZeroTierOneJNI.so to copy.
1) If your issue is with libzt, your issue should be here: https://github.com/zerotier/libzt
2) The old ant build.xml file hasn't been touched in years and should be removed. We just use Gradle's NDK support for our android app, and it's not something we ship separately as a library.
3) The java subfolder of this project is just a very thin wrapper around the C interface of ZeroTier. It requires a lot of work to get it up and running. https://github.com/zerotier/libzt would likely be a better bet for you to use instead.
Thanks for the update. That makes sense but it's a pity as I feel developers on mobile devices would find it very useful to network their application with a android released Zero-tier library. It would encourage more zero-tier subscriptions as well as the size of their networked applications grew.
I tested the java binding in libzt folder and it works well. Is there any tutorials or resources on how to convert it into an Android project and replace android sockets etc with it?
@Zod20 I can provide you with libzt .aar file for your android project. What API levels and architectures are you targeting?
EDIT: The current minimum API level we target is 21.
@Zod20 Yeah. The code you're talking about isn't for that. That's what libzt is for :)
The java/ subfolder of the main ZeroTier repository is mainly for use with Android's VpnService interface for system wide VPN-like connections. All the networking code is left up to the user to do. libzt, however, gives you a full ZeroTier instance local to an individual application.
@joseph-henry Much appreciated. My project is configured for android sdk 16-28 but i'll swap it for 21-28. So please provide from 21 to 28.
Common architectures will be sufficient - so armeabi, armeabi-v7a, arm64, x86, x86_64 - please add any common recent architectures i'm missing
Once again thank you for taking the time!
@joseph-henry Still waiting if you don't mind
Here's a slightly older armeabi-v7a build with a known ipv6 bug. Next week I'll get you newer build with the issue fixed:
https://download.zerotier.com/RELEASES/1.2.8/dist/libzt/android/
And here's some example code to give you a sense of how the API works:
https://github.com/zerotier/libzt/blob/master/examples/java/ExampleApp.java
If you have any issues go ahead and open a new ticket on the https://github.com/zerotier/libzt repo and I can address them there. Happy hacking!
@joseph-henry the links are broken, is it possible for you to reupload them? I need to make ZeroTier work on android, I have *jar and now need *.so files to link.
android studio asks me for a libzt.aar
https://github.com/zerotier/libzt/tree/master/examples/android/ExampleAndroidApp
Please someone help me, I need to create an android application that connects to ZeroTier using my ID.