Documentation Index
Fetch the complete documentation index at: https://docs.edgeimpulse.com/llms.txt
Use this file to discover all available pages before exploring further.
Android series overview
These tutorials walk you through deploying Edge Impulse models on Android, from running inference on static test data to real-time camera and audio apps to hardware-accelerated inference on Qualcomm’s NPU. All examples use the Android NDK to call the Edge Impulse C++ SDK directly from Kotlin or Java, giving you low-latency, fully on-device inference without a network connection. If you’re new to Edge Impulse, complete a model training tutorial first to train and export a model, then come back here to deploy it to Android.Prerequisites
Before starting any tutorial in this series, make sure you have the following:- An Edge Impulse account with a trained model
- Android Studio (Ladybug 2024.2.2 or later)
- Android SDK tools: API 35, NDK 27.0.12077973, CMake 3.22.1
- Basic familiarity with Android development
How the examples work
All examples in this series share the same underlying architecture. The Edge Impulse C++ SDK handles signal processing and neural network execution in native code, while your Kotlin or Java app manages the UI, sensor access, and data capture. A JNI bridge innative-lib.cpp connects the two layers, keeping the performance-critical inference path in C++ while letting you build a standard Android UI around it.
See the Android NDK documentation for more on integrating native C++ into Android apps.
| Layer | Components | Responsibility |
|---|---|---|
| Data source | Camera2, AudioRecord, SensorManager | Captures images, audio, or IMU data |
| Java/Kotlin | Activities, UI, preprocessing | User interface and data conversion |
| JNI bridge | native-lib.cpp | Type conversion between Java and C++ |
| C++ native | Edge Impulse SDK | Signal processing and feature extraction |
| TensorFlow Lite | Runtime libraries | Neural network execution |
| Hardware | CPU, NPU, DSP | Physical computation |
| Optional delegate | QNN | Hardware acceleration on Qualcomm Snapdragon devices |
Quick start
All examples live in the same repository. Clone it once, then navigate into whichever example you want to run:Tutorials
Static buffer inference
Run inference on hardcoded test data. The simplest starting point, with no sensors required.
Keyword spotting
Recognize wake words and voice commands from your phone’s microphone in real time.
Camera inference
Run object detection or image classification on a live camera feed using Camera2.
WearOS motion inference
Classify motion data from a WearOS device’s accelerometer and gyroscope.
QNN hardware acceleration
Speed up inference 10× or more using Qualcomm’s Hexagon NPU on Snapdragon devices.
QNN speech to image GenAI
Generate images from spoken prompts using a quantized GenAI pipeline running entirely on-device.
Common workflow
Every tutorial in this series follows the same five-step process to go from a trained Edge Impulse model to a running Android app.-
Export your model: In Edge Impulse Studio, go to Deployment → Android (C++ library) and click Build. Download the
.ziparchive. -
Download TensorFlow Lite libraries: Each example includes a script that fetches the required TFLite runtime binaries:
-
Copy your model files: Extract the downloaded
.zipand copy all files intoapp/src/main/cpp/. Don’t overwrite the existingCMakeLists.txt; the project’s build configuration is already set up for you. -
Update the test features: Open
native-lib.cppand paste in the raw features from one of your test samples in Studio. This lets you verify the model produces correct output before wiring up a live sensor. - Build and run: Open the project in Android Studio, click Build → Make Project, then run it on a device or emulator.
Platform support
| ABI | Status | Target devices |
|---|---|---|
arm64-v8a (64-bit) | Recommended | All modern Android devices |
armeabi-v7a (32-bit) | Requires config | Older devices; see the 32-bit setup steps in the repository README |
Performance optimization
By default, all examples use XNNPACK for CPU acceleration. XNNPACK is bundled with TensorFlow Lite and requires no extra configuration; it transparently accelerates supported operations across any Android device and typically provides a meaningful speedup over plain TFLite out of the box. If you’re running on a Qualcomm Snapdragon device, you can go significantly further with QNN (Qualcomm AI Engine Direct). QNN offloads compatible model operations to the Hexagon NPU or DSP, and on tested devices delivers 10× or greater speedup over CPU-only inference. INT8 quantization is required to get the best results. See the QNN hardware acceleration tutorial for a full walkthrough.Repositories
| Repository | Description |
|---|---|
| example-android-inferencing | Static buffer, KWS, camera, and WearOS examples |
| qnn-hardware-acceleration | QNN object detection with Qualcomm Hexagon NPU |
| qnn-genai-speech_to_image | QNN speech-to-image GenAI pipeline |