From d965187acdb3b810603da5d843ce443c6b165232 Mon Sep 17 00:00:00 2001 From: shijing xian Date: Sat, 31 Jan 2026 21:50:23 -0800 Subject: [PATCH 1/4] initial version that seems functional --- examples/mobile/Cargo.toml | 2 + .../android/.idea/AndroidProjectSystem.xml | 6 + .../android/.idea/codeStyles/Project.xml | 123 +++++ .../.idea/codeStyles/codeStyleConfig.xml | 5 + examples/mobile/android/.idea/compiler.xml | 2 +- .../.idea/deploymentTargetSelector.xml | 18 + examples/mobile/android/.idea/gradle.xml | 5 +- examples/mobile/android/.idea/migrations.xml | 10 + examples/mobile/android/.idea/misc.xml | 2 +- .../android/.idea/runConfigurations.xml | 17 + examples/mobile/android/.idea/vcs.xml | 2 + examples/mobile/android/app/build.gradle | 24 +- .../mobile/android/app/libs/libwebrtc.jar | Bin 989184 -> 1012165 bytes .../android/app/src/main/AndroidManifest.xml | 2 + .../main/java/io/livekit/rustexample/App.kt | 88 ++- .../io/livekit/rustexample/MainActivity.kt | 300 ++++++++++- .../io/livekit/rustexample/MediaManager.kt | 370 +++++++++++++ .../src/main/jniLibs/arm64-v8a/libmobile.so | Bin 0 -> 15010600 bytes examples/mobile/android/build.gradle | 6 +- .../android/gradle/wrapper/gradle-wrapper.jar | Bin 59203 -> 43739 bytes .../gradle/wrapper/gradle-wrapper.properties | 5 +- examples/mobile/android/gradlew | 284 ++++++---- examples/mobile/android/gradlew.bat | 37 +- examples/mobile/src/lib.rs | 499 +++++++++++++++++- 24 files changed, 1634 insertions(+), 173 deletions(-) create mode 100644 examples/mobile/android/.idea/AndroidProjectSystem.xml create mode 100644 examples/mobile/android/.idea/codeStyles/Project.xml create mode 100644 examples/mobile/android/.idea/codeStyles/codeStyleConfig.xml create mode 100644 examples/mobile/android/.idea/deploymentTargetSelector.xml create mode 100644 examples/mobile/android/.idea/migrations.xml create mode 100644 examples/mobile/android/.idea/runConfigurations.xml create mode 100644 examples/mobile/android/app/src/main/java/io/livekit/rustexample/MediaManager.kt create mode 100755 examples/mobile/android/app/src/main/jniLibs/arm64-v8a/libmobile.so diff --git a/examples/mobile/Cargo.toml b/examples/mobile/Cargo.toml index ad14cf121..0c5758b23 100644 --- a/examples/mobile/Cargo.toml +++ b/examples/mobile/Cargo.toml @@ -9,6 +9,8 @@ lazy_static = "1.4.0" livekit = { workspace = true, features = ["rustls-tls-native-roots"] } log = "0.4.19" tokio = { version = "1", features = ["full"] } +futures = "0.3" +parking_lot = "0.12" [target.'cfg(target_os = "android")'.dependencies] jni = "0.21.1" diff --git a/examples/mobile/android/.idea/AndroidProjectSystem.xml b/examples/mobile/android/.idea/AndroidProjectSystem.xml new file mode 100644 index 000000000..4a53bee8c --- /dev/null +++ b/examples/mobile/android/.idea/AndroidProjectSystem.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/examples/mobile/android/.idea/codeStyles/Project.xml b/examples/mobile/android/.idea/codeStyles/Project.xml new file mode 100644 index 000000000..7643783a8 --- /dev/null +++ b/examples/mobile/android/.idea/codeStyles/Project.xml @@ -0,0 +1,123 @@ + + + + + + + + + + \ No newline at end of file diff --git a/examples/mobile/android/.idea/codeStyles/codeStyleConfig.xml b/examples/mobile/android/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 000000000..79ee123c2 --- /dev/null +++ b/examples/mobile/android/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/examples/mobile/android/.idea/compiler.xml b/examples/mobile/android/.idea/compiler.xml index b589d56e9..b86273d94 100644 --- a/examples/mobile/android/.idea/compiler.xml +++ b/examples/mobile/android/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/examples/mobile/android/.idea/deploymentTargetSelector.xml b/examples/mobile/android/.idea/deploymentTargetSelector.xml new file mode 100644 index 000000000..2f860cc36 --- /dev/null +++ b/examples/mobile/android/.idea/deploymentTargetSelector.xml @@ -0,0 +1,18 @@ + + + + + + + + + \ No newline at end of file diff --git a/examples/mobile/android/.idea/gradle.xml b/examples/mobile/android/.idea/gradle.xml index a9f4e522a..639c779c3 100644 --- a/examples/mobile/android/.idea/gradle.xml +++ b/examples/mobile/android/.idea/gradle.xml @@ -1,11 +1,12 @@ +