-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from hiking90/main
Add Android descriptions
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Android Build | ||
## NDK Install | ||
The NDK can be installed using Android Studio, or it can be downloaded and installed from the following URL. | ||
|
||
* [NDK guides](https://developer.android.com/ndk/guides) | ||
* [NDK downloads](https://developer.android.com/ndk/downloads) | ||
|
||
## Cargo NDK Install | ||
To build rsbinder using the NDK, the installation of [cargo-ndk](https://crates.io/crates/cargo-ndk) is required. | ||
|
||
## Build **rsbinder** with NDK | ||
After installing cargo-ndk, various targets were installed with ```$ rustup target add```. Use this target information to build with the following command. | ||
|
||
``` | ||
$ cargo ndk -t x86_64-linux-android build | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
**rsbinder** supports not only Linux but also Android. Since Android already has an environment prepared for binder communication, **rsbinder**, **rsbinder-aidl**, and **rsbinder-hub** are utilized for development. There is no need to create a binder device or run a service manager, so **rsbinder-tools** are not used. | ||
|
||
For building in the Android environment, it is necessary to install the NDK, and an additional Rust build environment that utilizes the NDK is required. | ||
|
||
[Android Build](./android-build.md) | ||
|
||
## Compatibility with Android Versions | ||
안드로이드 버전에 따른 Binder IPC에 대한 호환성 문제가 있다. | ||
현재 확인된 사항은 Android 12를 기준으로 그 이전, 이후의 호환성 문제가 있다. | ||
|
||
당신의 SW가 Android 11과 12에서 모두 동작해야 한다면, Android 버전을 rsbinder::set_android_version() api를 통해 설정해야 한다. | ||
|
||
Android Version 정보는 다음과 같이 확인하고, 설정할 수 있다. | ||
|
||
``` | ||
use android_system_properties::AndroidSystemProperties; | ||
let properties = AndroidSystemProperties::new(); | ||
if let Some(version) = properties.get("ro.build.version.release") { | ||
rsbinder::set_android_version(version.parse()) | ||
} | ||
``` |