Inference app in Android phone
Install NDK in Android Studio
ANN model based inference engine is coded in C++ and C. To make a library by using inference engine code, there is a need to have NDK also installed in Android studio. In the following installation of Android studio and also installation of NDK are given in detail. Following is installed in Ubuntu 18.04 x86 machine.
Installation of dependencies
Android Studio requires OpenJDK version 8 or above to be installed to your system
sudo apt update
sudo apt install openjdk-8-jdk
Install Android Studio
sudo snap install android-studio --classic
start Android Studio either by typing android-studio in your terminal or by clicking on the Android Studio icon (Activities -> Android Studio).
SDK required version
Use SDK 22 or above.
What is used in present build of J722 version of App is SDK 29
Use SDK manager to install the following components ( NDK). these components useful to build JNI part of Inference engine
Packages to install:
- LLDB 3.1 (lldb;3.1)
- CMake 188.8.131.5288404 (cmake;184.108.40.20688404)
- NDK (Side by side) 20.1.5948944 (ndk;20.1.5948944)
Using Android studio build Inference engine as given in the following workflow and copy the same APK into Android phone .
Windows 10 or Ubuntu 18.04 with Android Studio ( the latest stable version of Android Studio is version 220.127.116.11.) is used. NDK (Side by side) 20.1.5948944 (ndk;20.1.5948944) is used to handle JNI side lib creation for Inference Engine,
Inference engine full source code is given in “ https://github.com/DLinIoTedge/NN “
Following diagram provides information on workflow to create J722 application in the form of APK that can run in Android phone.