Skip to content

Commit 67d4e03

Browse files
committed
[Android docs] Minor update to existing sections
1 parent 623a965 commit 67d4e03

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

docs/source/using-executorch-android.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
# Using ExecuTorch on Android
22

3-
To use from Android, ExecuTorch provides Java API bindings and Android platform integration, available as a AAR file. The ExecuTorch C++ APIs can also be used from Android native.
3+
To use from Android, ExecuTorch provides Java/Kotlin API bindings and Android platform integration, available as an AAR file.
4+
5+
Note: This page covers Android app integration through the AAR library. The ExecuTorch C++ APIs can also be used from Android native, and the documentation can be found on [this page about cross compilation](https://pytorch.org/executorch/main/using-executorch-building-from-source.html#cross-compilation).
46

57
## Installation
68

7-
We provide a prebuilt Android library (AAR), `executorch.aar` for both generic (image/audio processing) and LLAMA use case.
9+
We package all ExecuTorch Android libraries into an Android library (AAR), `executorch.aar` for both generic (image/audio processing) and LLM (LLaMA) use case. In each release, we will upload the prebuilt AAR artifacts. Users can also build the AAR from source.
10+
11+
### Contents of library
812

9-
## Contents of library
10-
- `executorch.aar`
11-
- [Java library](https://github.com/pytorch/executorch/tree/main/extension/android/src/main/java/org/pytorch/executorch)
12-
- JNI contains the JNI binding for the corresponding Java code, and ExecuTorch native library, including core ExecuTorch runtime libraries, XNNPACK backend, Portable kernels, Optimized kernels, Quantized kernels, and LLAMA-specific Custom ops library.
13-
- Comes with two ABI variants, arm64-v8a and x86\_64.
13+
The AAR artifact contains the Java library for users to integrate with their Java/Kotlin application code, as well as the corresponding JNI library (.so file), which is loaded by the Java code during initialization.
14+
15+
- [Java library](https://github.com/pytorch/executorch/tree/main/extension/android/src/main/java/org/pytorch/executorch)
16+
- JNI contains the JNI binding for the corresponding Java code, and ExecuTorch native library, including
17+
- core ExecuTorch runtime libraries
18+
- XNNPACK backend
19+
- Portable kernels
20+
- Optimized kernels
21+
- Quantized kernels
22+
- LLaMa-specific Custom ops library.
23+
- Comes with two ABI variants, arm64-v8a and x86\_64.
1424

1525
## Downloading AAR
1626

@@ -30,17 +40,27 @@ We provide a prebuilt Android library (AAR), `executorch.aar` for both generic (
3040

3141
To add the Java library to your app, simply download the AAR, and add it to your gradle build rule.
3242

43+
The Java package requires `fbjni` and `soloader`, and currently requires users to explicitly declare the dependency. Therefore, two more `dependencies` in gradle rule is required:
44+
```
45+
implementation("com.facebook.soloader:soloader:0.10.5")
46+
implementation("com.facebook.fbjni:fbjni:0.5.1")
47+
```
48+
49+
### Example usage
50+
3351
In your app working directory, such as example executorch/examples/demo-apps/android/LlamaDemo,
3452
```
3553
mkdir -p app/libs
36-
curl https://ossci-android.s3.amazonaws.com/executorch/release/executorch-241002/executorch.aar -o app/libs/executorch.aar
54+
curl https://ossci-android.s3.amazonaws.com/executorch/release/v0.5.0-rc3/executorch.aar -o app/libs/executorch.aar
3755
```
3856

3957
And include it in gradle:
4058
```
4159
# app/build.grardle.kts
4260
dependencies {
4361
implementation(files("libs/executorch.aar"))
62+
implementation("com.facebook.soloader:soloader:0.10.5")
63+
implementation("com.facebook.fbjni:fbjni:0.5.1")
4464
}
4565
```
4666

0 commit comments

Comments
 (0)