Android Kotlin and Java codes object detection on phone Camera using tflite interpreter

Build instruction:

Run below commands in Linux command line to installing Java:

sudo apt install openjdk-8-jdk-headless

Then run to installing Android SDK:

mkdir -p Android/Sdk
unzip -d Android/Sdk

export ANDROID_HOME=$HOME/Android/Sdk
export PATH="$ANDROID_HOME/emulator:$ANDROID_HOME/cmdline-tools:$ANDROID_HOME/cmdline-tools/bin:$ANDROID_HOME/platform-tools:$PATH"

sdkmanager --sdk_root=${ANDROID_HOME} "tools"

sdkmanager --update
sdkmanager --list
sdkmanager --install "build-tools;33.0.3" "platform-tools" "platforms;android-33" "tools"
sdkmanager --licenses

Note: Sometimes “$ANDROID_HOME/cmdline-tools/bin” path is “$ANDROID_HOME/cmdline-tools/latest/bin” instead, So check it manually.

Then run to building APK:

git clone
cd CameraX-tflite
./gradlew assembleDebug


Build APK in Google Colab:

Run below commands in Google Colab:

!mkdir -p sdk
!unzip -d sdk
!yes | ./sdk/cmdline-tools/bin/sdkmanager --sdk_root=/content/sdk "tools"
!git clone
!chmod -c 755 /content/CameraX-tflite/gradlew
!export ANDROID_HOME=/content/sdk && cd /content/CameraX-tflite && ./gradlew assembleDebug
from google.colab import files'path_to_APK')

path_to_APK in Google Colab:




View Github