
Android Studio - Object Tracking and Detection - live debugging as demonstrated in the QNN example repository
Common architecture
All examples share the same fundamental high level overview. See the Android NDK documentation for more on native C++ integration here.| Layer | Components | Responsibility |
|---|---|---|
| Data Source | Camera2, AudioRecord, SensorManager | Capture images, audio, IMU data |
| Java/Kotlin | Activities, UI, Preprocessing | User interface and data conversion |
| JNI Bridge | native-lib.cpp | Type conversion (Java ↔ 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 (Qualcomm devices) |
Quick start
To get started with all Android examples, clone the main repository:Tutorials
Static Buffer Inference
Run inference with test data (15 min)
Camera Inference
Object detection and anomaly detection (30 min)
Keyword Spotting
Audio classification with microphone (30 min)
WearOS Motion
IMU-based motion classification (45 min)
QNN Acceleration
Qualcomm NPU hardware acceleration (1 hour)
Repositories
- Static Buffer Inference on Android
- Keyword Spotting on Android
- Camera Inference on Android
- WearOS Motion Inference on Android
- QNN Hardware Acceleration on Android
Prerequisites
- Edge Impulse account: Sign up
- Trained model: Complete a tutorial first
- Android Studio: Download (Ladybug 2024.2.2 or later)
- Tools: Android API 35, NDK 27.0.12077973, CMake 3.22.1
Tested model types
- Vision: FOMO, Object Detection, Visual Anomaly Detection
- Audio: Keyword Spotting (KWS)
- Motion: Accelerometer, Gyroscope classification
Common workflow
All tutorials follow this pattern:- Export model from Studio → Deployment → Android (C++ library)
- Download TFLite libraries:
- Copy model files to
app/src/main/cpp/(skip CMakeLists.txt) - Update test features in
native-lib.cpp - Build and run in Android Studio
Platform support
| Architecture | Status | Notes |
|---|---|---|
| arm64-v8a (64-bit) | Recommended | All modern devices |
| armeabi-v7a (32-bit) | Requires config | Older devices, see 32-bit steps in the android examples README |
Performance optimization
- XNNPACK: CPU acceleration (included by default)
- QNN: Qualcomm NPU acceleration (see QNN tutorial)