Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
edgchen1 authored Aug 9, 2024
1 parent 2d78756 commit 514307c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
13 changes: 7 additions & 6 deletions docs/build/android.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ The SDK and NDK packages can be installed via Android Studio or the sdkmanager c
Android Studio is more convenient but a larger installation.
The command line tools are smaller and usage can be scripted, but are a little more complicated to setup. They also require a Java runtime environment to be available.

Generally, you'll want to use the latest stable NDK version. We'll refer to the version that you use as `<NDK version>` from here on.

Resources:

* [API levels](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html)
Expand All @@ -36,16 +38,15 @@ Resources:
2. Install any additional SDK Platforms if necessary

* File->Settings->Appearance & Behavior->System Settings->Android SDK to see what is currently installed
* Note that the SDK path you need to use as --android_sdk_path when building ORT is also on this configuration page
* Note that the SDK path you need to use as `--android_sdk_path` when building ORT is also on this configuration page
* Most likely you don't require additional SDK Platform packages as the latest platform can target earlier API levels.

3. Install an NDK version

* File->Settings->Appearance & Behavior->System Settings->Android SDK
* 'SDK Tools' tab
* Select 'Show package details' checkbox at the bottom to see specific versions. By default the latest will be installed which should be fine.
* The NDK path will be the 'ndk/{version}' subdirectory of the SDK path shown
* e.g. if 21.1.6352462 is installed it will be {SDK path}/ndk/21.1.6352462
* The NDK path will be the `ndk/<NDK version>` subdirectory of the SDK path shown

### sdkmanager from command line tools

Expand Down Expand Up @@ -81,8 +82,8 @@ Resources:
* Install the NDK
* Find the available NDK versions by running `sdkmanager --list`
* Install
* install the desired version, e.g., `sdkmanager --install "ndk;21.1.6352462"`
* NDK path in our example with this install would be `.../Android/ndk/21.1.6352462`
* install the desired version, e.g., `sdkmanager --install "ndk;<NDK version>"`
* NDK path in our example with this install would be `.../Android/ndk/<NDK version>`

## Android Build Instructions

Expand All @@ -97,7 +98,7 @@ The [Ninja](https://ninja-build.org/) generator needs to be used to build on Win
e.g. using the paths from our example
```
./build.bat --android --android_sdk_path .../Android --android_ndk_path .../Android/ndk/21.1.6352462 --android_abi arm64-v8a --android_api 27 --cmake_generator Ninja
./build.bat --android --android_sdk_path .../Android --android_ndk_path .../Android/ndk/<NDK version> --android_abi arm64-v8a --android_api 27 --cmake_generator Ninja
```
### Cross compiling on Linux and macOS
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/mobile/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ One of the outputs of the ORT format conversion is a build configuration file, c

To give an idea of the binary size difference between the pre-built package and a custom build:

File|Pre-built package size (bytes)|Custom build size (bytes)
File|1.18.0 pre-built package size (bytes)|1.18.0 custom build size (bytes)
-|-|-
AAR|24415212|7532309
`jni/arm64-v8a/libonnxruntime.so`, uncompressed|16276832|3962832
`jni/x86_64/libonnxruntime.so`, uncompressed|18222208|4240864

This custom build supports the operators needed to run a ResNet50 model. It also has limited framework support (built with `--minimal_build=extended`), only supporting ORT format models. It has support for the NNAPI and XNNPACK execution providers.
This custom build supports the operators needed to run a ResNet50 model. It requires the use of ORT format models (as it was built with `--minimal_build=extended`). It has support for the NNAPI and XNNPACK execution providers.

0 comments on commit 514307c

Please sign in to comment.