• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Using Android prebuilt libraries (AAR)
2
3We provide two prebuilt Android libraries (AAR), `executorch.aar` for generic use case (image/audio processing) and `executorch_llama.aar` for LLAMA use case.
4
5## Contents of libraries
6- `executorch.aar`
7  - [Java library](https://github.com/pytorch/executorch/tree/main/extension/android/src/main/java/org/pytorch/executorch)
8  - JNI contains the JNI binding for [NativePeer.java](https://github.com/pytorch/executorch/blob/main/extension/android/src/main/java/org/pytorch/executorch/NativePeer.java) and ExecuTorch native library, including core ExecuTorch runtime libraries, XNNPACK backend, Portable kernels, Optimized kernels, and Quantized kernels.
9    - Comes with two ABI variants, arm64-v8a and x86_64.
10- `executorch_llama.aar`
11  - [Java library](https://github.com/pytorch/executorch/tree/main/extension/android/src/main/java/org/pytorch/executorch) (Note: it contains the same Java classes as the previous Java, but it does not contain the JNI binding for generic Module/NativePeer Java code).
12  - JNI contains the JNI binding for [LlamaModule.java](https://github.com/pytorch/executorch/blob/main/extension/android/src/main/java/org/pytorch/executorch/LlamaModule.java) 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.
14
15## Downloading AAR
16[executorch.aar](https://ossci-android.s3.amazonaws.com/executorch/release/executorch-241002/executorch.aar)
17[executorch.aar.sha256sums](https://ossci-android.s3.amazonaws.com/executorch/release/executorch-241002/executorch.aar.sha256sums)
18
19## Using prebuilt libraries
20
21To add the Java library to your app, simply download the AAR, and add it to your gradle build rule.
22
23In your app working directory, such as example executorch/examples/demo-apps/android/LlamaDemo,
24```
25mkdir -p app/libs
26curl https://ossci-android.s3.amazonaws.com/executorch/release/executorch-241002/executorch.aar -o app/libs/executorch.aar
27```
28
29And include it in gradle:
30```
31# app/build.grardle.kts
32dependencies {
33    implementation(files("libs/executorch.aar"))
34}
35```
36
37Now you can compile your app with the ExecuTorch Android library.
38