Reputation: 444
I am currently using Gzip to compress attachments in Couchbase on Android. Recently bumped into Snappy, that seems to be an efficient solution, so decided to use Snappy instead of GZip. Snappy github - https://github.com/xerial/snappy-java But what I am confused is how to use the Snappy library in Android. I downloaded the latest version of snappy (1.1.2.1) from http://central.maven.org/maven2/org/xerial/snappy/snappy-java/1.1.2.1/ and dropped it in the libs folder of the Android project. I now can reference the Snappy class methods in my Android source code, which made me think that everything was going great so far. Now when I run the app, I get the following error when I call Snappy.compress(byte[] data) -
org.xerial.snappy.SnappyError: [FAILED_TO_LOAD_NATIVE_LIBRARY] no native library is found for os.name=Linux and os.arch=aarch64
org.xerial.snappy.SnappyLoader.findNativeLibrary(SnappyLoader.java:331)
org.xerial.snappy.SnappyLoader.loadNativeLibrary(SnappyLoader.java:171)
org.xerial.snappy.SnappyLoader.load(SnappyLoader.java:152)
org.xerial.snappy.Snappy.<clinit>(Snappy.java:47)
I created a sample java class to test Snappy, and it works great. So, from my understanding, its missing some native libraries for the Linux kernel, but even from the description on the github page, cannot figure out a way to build the jar file that I can use on Android.
Any help would be greatly appreciated. Thanks
Upvotes: 2
Views: 1534
Reputation: 7032
You could give a shot at https://github.com/dain/snappy. It's a pure java port so no need for native libs.
Upvotes: 0
Reputation: 5637
Looks like Linux/aarch64 for Snappy is in the works, but not yet released: https://github.com/xerial/snappy-java/issues/134
Upvotes: 0