Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android setup documentation #418

Open
Gibbz opened this issue Dec 24, 2024 · 0 comments
Open

Android setup documentation #418

Gibbz opened this issue Dec 24, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Gibbz
Copy link

Gibbz commented Dec 24, 2024

I'm working on adding this to my android project. The project is using xbuild and slint, which uses and android activity crate ( https://github.com/slint-ui/slint/tree/master/internal/backends/android-activity ).

Ive completed the steps below:

<cd to Projects folder>
git clone https://github.com/deviceplug/jni-utils-rs.git
cd jni-utils-rs
cargo build --features=build-java-support
jar files located in /target/debug/java/libs

cd ..
git clone https://github.com/deviceplug/btleplug.git
cd btleplug/src/droidplug/java
edit build.gradle, comment and replace:
dependencies {
    implementation files('/home/bronson/Projects/jni-utils-rs/target/debug/java/libs/jni-utils-0.1.1-SNAPSHOT.jar')
}
./gradlew build 
btleplug/src/droidplug/java/build/outputs/aar/

This gets step 1 complete, and most of step 2...

A quick overview of the build process:

1  For java, you will need the java portion of [jni-utils-rs](https://github.com/deviceplug/jni-utils-rs) available either in a Maven repository or locally (if locally, you'll need to check out btleplug and change the gradle file).
2.  Either build the java portion of btleplug, in the src/droidplug/java directory, using the included gradle files, and them to a Maven repo, or have the Java portion of your android app point to that as a local implementation.
3.  For Rust, the build should go as normal, though we recommend using cargo-ndk to build. Output the jniLibs and make sure they end up in the right place in your app.

But how do i do step 2? have the Java portion of your android app point to that as a local implementation when slint takes care of this all for me?

Do I need to modify the slint source code to add the btleplug stuff? Or load that through rust?

They have no gradle files, no mainactivity... do I modify the java?

@Gibbz Gibbz added the bug Something isn't working label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant