{"id":21803340,"url":"https://github.com/cesarvaliente/rust-android-sample","last_synced_at":"2026-05-11T04:44:54.621Z","repository":{"id":141836925,"uuid":"472816959","full_name":"CesarValiente/rust-android-sample","owner":"CesarValiente","description":"This repository shows how we can use Rust to build Android apps/libraries.","archived":false,"fork":false,"pushed_at":"2022-03-28T13:33:39.000Z","size":291,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-26T04:11:16.049Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CesarValiente.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-22T14:58:31.000Z","updated_at":"2022-03-28T12:50:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"58b1f7ea-e039-4af8-966f-0a125a67ee68","html_url":"https://github.com/CesarValiente/rust-android-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CesarValiente%2Frust-android-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CesarValiente%2Frust-android-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CesarValiente%2Frust-android-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CesarValiente%2Frust-android-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CesarValiente","download_url":"https://codeload.github.com/CesarValiente/rust-android-sample/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244752578,"owners_count":20504319,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-27T11:41:40.781Z","updated_at":"2026-05-11T04:44:49.591Z","avatar_url":"https://github.com/CesarValiente.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rust-android-sample\n\nThis is a sample app that shows how we can use [Rust](https://www.rust-lang.org/) programming language to build shared code that can be used by Android apps.\nThis project is based in the [mozilla/rust-android-gradle plugin](https://github.com/mozilla/rust-android-gradle), specifically in its [app sample](https://github.com/mozilla/rust-android-gradle/tree/master/samples).\n\n## What does this sample do?\nIn this sample we build a very small `Rust library` and a very simple `Kotlin Android app` that uses that library.\nThe app just call the Rust library and gets a result back using callback\n\n![App scenarios](android/art/app_scenarios.png)\n\n\n## How to build and deploy?\n\n1. Follow the [Get started](https://www.rust-lang.org/learn/get-started) section from the Rust main site.\n2. Clone the repo, and open it in Android Studio.\n3. Install all the specific **toolchains** that you will need/use. Find more info [here](https://github.com/mozilla/rust-android-gradle).\n4. Click on build/deploy app. It should automatically build and deploy in an emulator/device.\n\nIf you are in Windows and you find some **issues** when building about **not able to find `lgcc`**, please, have a look to [this issue](https://github.com/mozilla/rust-android-gradle/issues/89). I followed [this hack](https://github.com/mozilla/rust-android-gradle/issues/89#issuecomment-1079862019) and it works. At least is good enough till this issue is fixed.\n\nIf you want just to create your own app using the `rust-android-gradle` plugin, follow its [README](https://github.com/mozilla/rust-android-gradle/blob/master/README.md) instructions.\n\n\n## Useful resources\n\n1. [Get started with Rust](https://www.rust-lang.org/learn/get-started).\n2. [Rust language reference](https://doc.rust-lang.org/reference/introduction.html).\n3. [Building and deploying a Rust library on Android](https://mozilla.github.io/firefox-browser-architecture/experiments/2017-09-21-rust-on-android.html).\n4. [Rust on Android](https://medium.com/visly/rust-on-android-19f34a2fb43) + its [sample code](https://github.com/vislyhq/rust-android-example/tree/master/android).\n5. [Rust-Android-Gradle plugin](https://github.com/mozilla/rust-android-gradle) and its [samples](https://github.com/mozilla/rust-android-gradle/tree/master/samples).\n6. [Crate JNI](https://docs.rs/jni/latest/jni/) (note: as writing this latest is `0.19.0`).\n7. [The Manifest format](https://doc.rust-lang.org/cargo/reference/manifest.html).\n8. If you found issues when using `NDK \u003e= 23`, please check [this](https://github.com/rust-lang/rust/pull/85806).\n9. How to fix `NDK is not installed` issue. Please, [read this](https://nkaushik.com/android/fix-ndk-not-installed-error/#:~:text=%20How%20to%20fix%20NDK%20is%20not%20installed,in%20build.gradle%3A.%20Once%20the%20NDK%20is...%20More%20).\n10. If you find issues when using `NDK \u003e- 23` on `Windows` complaining about not finding `lgcc` library, please, [read this](https://github.com/mozilla/rust-android-gradle/issues/89).\n\n## Code of Conduct\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n## License\n\nBased in [rust-android-gradle](https://github.com/mozilla/rust-android-gradle) plugin samples under **[Apache License v2](https://github.com/mozilla/rust-android-gradle/blob/master/LICENSE)**.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcesarvaliente%2Frust-android-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcesarvaliente%2Frust-android-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcesarvaliente%2Frust-android-sample/lists"}