cargo-ndk - Build Rust code for Android

This cargo extension handles all the environment configuration needed for successfully building libraries

cargo-ndk - Build Rust code for Android

This cargo extension handles all the environment configuration needed for successfully building libraries for Android from a Rust codebase, with support for generating the correct jniLibs directory structure.

Installing

You'll also need to install all the toolchains you intend to use. Simplest way is with the following:

Modify as necessary for your use case.

Usage

If you have installed the NDK with Android Studio to its default location, cargo ndk will automatically detect the most recent NDK version and use it. This can be overriden by specifying the path to the NDK root directory in the ANDROID_NDK_HOME environment variable.

Example: building a library for 32-bit and 64-bit ARM systems

This specifies the Android targets to be built, the output directory to use for placing the .so files in the layout expected by Android, and then the ordinary flags to be passed to cargo.

Supported hosts

  • Linux
  • macOS (x86_64 and arm64)
  • Windows

Similar projects

  • cargo-lipo - for building iOS universal Rust libraries

License

This project is licensed under either of

  • Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or #404)

at your option.


Uyghurs are under attack in Xinjiang. The Chinese government is placing millions of people into indoctrination camps and engaging in forced labour.

Issues

Collection of the latest Issues

Information - Updated May 20, 2022

Stars: 263
Forks: 32
Issues: 4

Repositories & Extras

SUPER Android Analyzer

Secure, Unified, Powerful and Extensible Rust Android Analyzer

SUPER Android Analyzer

Rust core for native Android and iOS apps

The Android build contains a wrapper library, which is imported in the Android app with Carthage

Rust core for native Android and iOS apps

Very simple command line tool to setup configuration for android native binaries

If you want to use native binary in your android project, and you don't like to write it in C/C++, writting in rust can be...

Very simple command line tool to setup configuration for android native binaries

Rust bindings for Oboe library

Oboe High-Performance Audio library for Android

Rust bindings for Oboe library

The answer to "how do I use Rust on iOS and Android?"

cargo-mobile takes care of generating Xcode and Android Studio project files, building and running on device, generating project boilerplate, and a few other things!

The answer to "how do I use Rust on iOS and Android?"

EndToEnd Anonymus chatting app

With Rust Backend and Android support

EndToEnd Anonymus chatting app

swapi-rust-mobile

Crossplatform mobile solution based on Rust for IOS & Android

swapi-rust-mobile
Facebook Instagram Twitter GitHub Dribbble
Privacy