Skip to main content
These tutorials show how to deploy Edge Impulse models on Android, from inference on static test data to live camera and audio apps and acceleration on Qualcomm NPUs. Each example uses the Android NDK to call the Edge Impulse C++ SDK from Kotlin or Java, so inference runs on the device without a network connection. If you don’t have a trained model yet, complete one of the end-to-end tutorials first.

Prerequisites

How the examples work

The Edge Impulse C++ SDK runs signal processing and the neural network in native code. Your Kotlin or Java app handles the UI, sensor access, and data capture. A JNI bridge in native-lib.cpp connects the two layers. See the Android NDK documentation for more on native code in Android apps.

Get the examples

All examples live in one repository:
If this is your first Android example, start with Static buffer inference. It runs on hardcoded test data, so you can check the SDK integration before you add camera, audio, or motion input.

Tutorials

Collect a dataset

Android data collector

Upload phone sensor data, camera images, Wear OS heart rate, IMU, and GPS, BLE data from a Zephyr device, and USB OTG data from Arduino boards to your Edge Impulse project. Supports voice-controlled capture.

Deploy a trained model

Static buffer inference

Run inference on hardcoded test data, with no sensors required.

Keyword spotting

Detect wake words and voice commands from the phone’s microphone.

Camera inference

Run image classification, object detection, or visual anomaly detection on a live camera feed.

Motion inference on Wear OS

Classify motion from a Wear OS watch’s accelerometer and gyroscope.

QNN hardware acceleration

Speed up inference with the Hexagon NPU on Qualcomm Snapdragon devices.

QNN speech to image

Generate images from spoken prompts with Whisper and Stable Diffusion on the Hexagon NPU.

More ways to deploy

AR/XR factory floor (Unity + Quest 3)

Run an Edge Impulse FOMO model inside a Unity XR app on Meta Quest 3 or 3S to inspect bottle caps on a virtual conveyor.

ExecuTorch (PyTorch to Android)

Deploy PyTorch models to Android with ExecuTorch instead of the C++ SDK.

Common deployment workflow

Each deployment tutorial in this series follows the same steps. The Android data collector doesn’t embed a model, so it doesn’t use them.
  1. Export your model. In Edge Impulse Studio, go to Deployment, select Android (C++ library), click Build, and download the .zip file.
  2. Download the TensorFlow Lite libraries. Each example includes a script that fetches the TFLite runtime:
  3. Copy your model files. Extract the .zip file and copy its contents into app/src/main/cpp/. Keep the existing CMakeLists.txt, which already has the project’s build configuration.
  4. Update the test features. Paste the raw features from one of your test samples into native-lib.cpp, so you can check the model’s output before you connect a live sensor.
  5. Build and run. Open the project in Android Studio, select Build -> Make Project, and run it on a device or emulator.

Platform support

The deployment examples support Android API 24 and later, and build against API 35. The Android data collector needs API 28 or later because its TensorFlow Lite runtime uses aligned_alloc.

Performance optimization

All examples use XNNPACK for CPU acceleration by default. XNNPACK ships with TensorFlow Lite and needs no extra configuration. On Qualcomm Snapdragon devices, QNN (Qualcomm AI Engine Direct) offloads supported operations to the Hexagon NPU or DSP. It needs an INT8 quantized model, and the speedup depends on the model and device. See QNN hardware acceleration.

Repositories

Need help