You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Diwank Singh Tomer cb6885b398 deps: Upgrade dependencies
Signed-off-by: Diwank Singh Tomer <diwank.singh@gmail.com>
5 months ago
..
src query mutability 1 year ago
.gitignore use JNI for java interop 2 years ago
Cargo.toml deps: Upgrade dependencies 5 months ago
CozoJavaBridge.java update docs 2 years ago
README-zh.md update docs 2 years ago
README.md update readme 2 years ago
org_cozodb_CozoJavaBridge.h bump version and update API 2 years ago

README.md

Cozo-lib-java

This crate provides the JNI bindings for using Cozo in Java/JVM languages/Android.

You do not use this crate directly. Instead, use:

Keep reading only if the prebuilt binaries provided by these libraries do not suit your needs.

Building for JDK

With the Rust toolchain installed,

cargo build --release -p cozo_java -F storage-rocksdb

Building for Android

Building for Android is not easy, and we will be very sketchy.

The first thing to note is that you should omit -F storage-rocksdb from the build command above, unless you are prepared to manually change lots of build.rs flags in cozorocks to build the RocksDB dependency.

Then, in addition to adding Android targets to the Rust toolchain, you also need to set up the Android NDK cross-compilation and libraries paths, etc. This is notoriously hard to get right, but fortunately you can just use the Docker image here which has everything set up for you.

When everything is set up correctly, the following command show complete without errors:

for TARGET in aarch64-linux-android armv7-linux-androideabi i686-linux-android x86_64-linux-android; do
  cross build -p cozo_java --release --target=$TARGET
done

For running on modern Android phones, the single target aarch64-linux-android is probably enough.