Arm AI Portal

The Arm AI Portal is a catalog of AI models across different runtimes, use cases, and profiles that are optimized for different Arm-based targets. The AI Portal provides benchmarking and compatibility data, code examples, and deployment methods.

You’ll use an example application called Photo Upscale to upscale a saved photo locally on an Arm-based Android device. You’ll import a model, using QuickSRNetSmall first, run inference, compare image detail, and save the output as a PNG. The same application also supports SESR-M5 and RealESR-general-x4v3 models.

Use an Arm-based Android device with the arm64-v8a Application Binary Interface (ABI) and Android 9 (API 28) or later. The application accepts images at most 512 × 512 pixels. It produces an image four times wider and taller, up to 2048 × 2048. Start with the supplied 96 × 64 sample. If either dimension exceeds 512 pixels, resize a copy beforehand in an image editor.

Check the host development tools

You’ll use a terminal and a physical Arm-based Android phone. The setup commands install the Android SDK and help you verify the development environment before you build the application.

Before you run the commands, ensure that your development machine has the prerequisite tools installed.

Open a terminal. On Windows, use PowerShell.

Run the check for tools:

    

        
        

git --version
java -version
javac -version
python3 --version
python3 -m pip --version
curl --version
unzip -v
  

    
    

        
        

git --version
java -version
javac -version
python --version
python -m pip --version
$PSVersionTable.PSVersion
  

    

Install any missing host tools before continuing. Use Python 3.10 or later and JDK 17 for this Learning Path. The application pins Android Gradle Plugin 8.7.3 and Gradle 8.9, which are validated with JDK 17. Newer JDK releases aren’t validated for this workflow and can prevent Gradle from building the application.

If your machine has multiple JDK versions, set JAVA_HOME to the JDK 17 installation before continuing. Confirm that both java -version and javac -version report version 17. For JDK selection options, see Java versions in Android builds .

Note

Android Studio is optional for inspecting and running the project. This Learning Path validates the application on a physical Arm-based Android phone. You can use an Android Virtual Device (AVD) for additional functional testing on a compatible host, but it doesn’t replace the physical-phone validation. If you use an AVD, select a recent system image that supports the arm64-v8a libraries of the application.

Install the Android command-line tools

Download Android SDK Command-Line Tools , verify the pinned archive checksum, and place the tools under ANDROID_HOME:

    

        
        

if [ -z "${ANDROID_HOME:-}" ]; then
    case "$(uname -s)" in
        Darwin) export ANDROID_HOME="$HOME/Library/Android/sdk" ;;
        Linux) export ANDROID_HOME="$HOME/Android/Sdk" ;;
        *) printf 'Unsupported operating system.\n' >&2; false ;;
    esac
fi

case "$(uname -s)-$(uname -m)" in
    Darwin-arm64)
        android_cli_archive="commandlinetools-mac_arm64-15859902_latest.zip"
        android_cli_sha256="835b62a26162b229b441d1f6d4680383815a270809eb33522c0d480fa5002c4e"
        ;;
    Darwin-x86_64)
        android_cli_archive="commandlinetools-mac_x86_64-15859902_latest.zip"
        android_cli_sha256="c5a6378ab5cf7e0d5701921405115befff13e9ff7417fb588389338f8bd050f3"
        ;;
    Linux-*)
        android_cli_archive="commandlinetools-linux-15859902_latest.zip"
        android_cli_sha256="4e4c464f145a7512b57d088ac6c278c03c9eea610886b35a5e0804e74eedf583"
        ;;
    *) printf 'No Android command-line archive is configured for this computer.\n' >&2; false ;;
esac

android_cli_temp="$(mktemp -d)"
curl --fail --location \
    "https://dl.google.com/android/repository/$android_cli_archive" \
    --output "$android_cli_temp/$android_cli_archive"

if command -v sha256sum >/dev/null 2>&1; then
    printf '%s  %s\n' "$android_cli_sha256" "$android_cli_temp/$android_cli_archive" |
        sha256sum --check
else
    printf '%s  %s\n' "$android_cli_sha256" "$android_cli_temp/$android_cli_archive" |
        shasum -a 256 -c
fi

unzip -q "$android_cli_temp/$android_cli_archive" -d "$android_cli_temp"
mkdir -p "$ANDROID_HOME/cmdline-tools/latest"
cp -R "$android_cli_temp/cmdline-tools/." "$ANDROID_HOME/cmdline-tools/latest/"

export PATH="$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$PATH"
  

    
    

        
        

if (-not $env:ANDROID_HOME) {
    $env:ANDROID_HOME = "$env:LOCALAPPDATA\Android\Sdk"
}

$androidCliArchive = "commandlinetools-win-15859902_latest.zip"
$androidCliSha256 = "90ae805d20434428bffcb699c290860f19bb5f66a67e6b330067e3de801fb04a"
$androidCliTemp = Join-Path $env:TEMP "android-cli-$([guid]::NewGuid())"
$androidCliZip = Join-Path $androidCliTemp $androidCliArchive

New-Item -ItemType Directory -Path $androidCliTemp | Out-Null
Invoke-WebRequest `
    -Uri "https://dl.google.com/android/repository/$androidCliArchive" `
    -OutFile $androidCliZip

$downloadedSha256 = (Get-FileHash $androidCliZip -Algorithm SHA256).Hash
if ($downloadedSha256 -ne $androidCliSha256) {
    throw "Android command-line tools checksum verification failed."
}

Expand-Archive -Path $androidCliZip -DestinationPath $androidCliTemp
$latestTools = Join-Path $env:ANDROID_HOME "cmdline-tools\latest"
New-Item -ItemType Directory -Force -Path $latestTools | Out-Null
Copy-Item -Path "$androidCliTemp\cmdline-tools\*" `
    -Destination $latestTools -Recurse -Force

$env:Path = "$latestTools\bin;$env:ANDROID_HOME\platform-tools;$env:Path"
  

    

If you already have an SDK in ANDROID_HOME, the commands reuse that location.

The export commands and PowerShell environment assignments apply to the current terminal. Continue in the same terminal. If you use a new terminal, you’ll need to set ANDROID_HOME to the same directory. You’ll also need to add cmdline-tools/latest/bin and platform-tools to PATH again.

Install and verify the required SDK packages

Review and accept the Android SDK licenses when prompted.

After accepting licenses, install Platform-Tools, Android SDK Platform 35, and Build-Tools 35.0.0:

    

        
        

sdkmanager --sdk_root="$ANDROID_HOME" --licenses
sdkmanager --sdk_root="$ANDROID_HOME" \
    "platform-tools" \
    "platforms;android-35" \
    "build-tools;35.0.0"

sdkmanager --version
adb version
test -d "$ANDROID_HOME/platforms/android-35"
test -d "$ANDROID_HOME/build-tools/35.0.0"
  

    
    

        
        

sdkmanager.bat "--sdk_root=$env:ANDROID_HOME" --licenses
sdkmanager.bat "--sdk_root=$env:ANDROID_HOME" `
    "platform-tools" `
    "platforms;android-35" `
    "build-tools;35.0.0"

sdkmanager.bat --version
adb version
Test-Path "$env:ANDROID_HOME\platforms\android-35"
Test-Path "$env:ANDROID_HOME\build-tools\35.0.0"
  

    

The final two checks return no output on macOS or Linux when the directories exist. On Windows, both checks should return True.

What you’ve accomplished and what’s next

You’ve now installed the Android command-line tools and verified the required SDK packages.

Next, you’ll connect an Arm-based Android phone and build Photo Upscale.