Skip to content

liquidos-ai/AutoAgents-Android-Example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android Agent Example

This example shows a simple Android UI (Kotlin + Compose) that calls a Rust JNI bridge which runs an AutoAgents BasicAgent backed by autoagents-llamacpp.

Layout

  • android/ - Android Studio project (UI + JNI bridge usage)
  • src/lib.rs - Rust JNI bridge that calls the AutoAgents llama.cpp backend

Build the JNI library

Use cargo-ndk to build the shared library for Android:

cargo install cargo-ndk
cargo ndk -t arm64-v8a -o android/app/src/main/jniLibs -P 29 build -p agent_android --release

This produces libagent_android.so under android/app/src/main/jniLibs/arm64-v8a/.

Run the Android app

  1. Open examples/agent_android/android in Android Studio.
  2. Run the app and send a prompt.

Run on a connected Android device (ADB)

  1. Enable Developer Options and USB debugging on the device.
  2. Verify the device is detected:
    adb devices
  3. Build the Rust JNI library (set your NDK path):
    export ANDROID_NDK=/home/<USERNAME>/Android/Sdk/ndk/29.0.14206865
    export ANDROID_API_LEVEL=29
    export ANDROID_PLATFORM=android-29
    cargo ndk -t arm64-v8a -P 29 -o android/app/src/main/jniLibs build -p agent_android --release
  4. Install the Android app to the connected device:
    cd android
    ./gradlew installDebug
  5. Open the app and set the model path (for example, /data/local/tmp/model.gguf).

NOTE: This app is completely vibe-coded!

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published