You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/using-executorch-android.md
+32-10Lines changed: 32 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,26 @@
1
1
# Using ExecuTorch on Android
2
2
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).
4
6
5
7
## Installation
6
8
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.
- 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.
- 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.
14
24
15
25
## Downloading AAR
16
26
@@ -28,19 +38,31 @@ We provide a prebuilt Android library (AAR), `executorch.aar` for both generic (
28
38
29
39
## Using prebuilt libraries
30
40
31
-
To add the Java library to your app, simply download the AAR, and add it to your gradle build rule.
41
+
To add the Java library to your app:
42
+
1. Download the AAR.
43
+
2. Add it to your gradle build rule as a file path.
44
+
45
+
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:
0 commit comments