An Android app that performs numerical integration to estimate a device's real-time position.
- Install Android Studio
- Install Rust
- Install build toolchains for Android
rustup target add aarch64-linux-android x86_64-linux-android
- Install cargo-ndk
cargo install cargo-ndk
- Specify path to NDK by setting
ANDROID_NDK_HOME
env variable - Install sscache for significantly shorter build time
cargo install sccache --locked
- Define build.rustc-wrapper in the cargo configuration file. Add the following to
$HOME/.cargo/config.toml
or%USERPROFILE%\.cargo\config.toml
:
[build]
rustc-wrapper = "~/.cargo/bin/sccache"
Android build is managed by cargo-ndk-android-gradle. Simply click Run 'app'
in Android Studio.
It is essentially running the following commands under the hood:
cargo ndk -t arm64-v8a -o app/src/main/jniLibs/ build
./gradlew.bat build
./gradlew.bat installDebug
adb shell am start -n com.mrjohn6774.androidpositionestimator/.MainActivity
Build and run on desktop
cargo run --features="desktop"