Compile and embed Dlib in your Android projects with ease.
Compile and embed Dlib (and, optionally OpenCV) in your Android projects with ease.
From AndroidStudio at tool > SDK Manager > SDK Tools
install:
setup.sh
(Linux user) or setup.ps1
(Windows user) script:
AndroidCmake
variable with the path to your Android CMake excutable (is usually inside the android sdk
folder).NDK
variable with the path to your Android NDK (ndk-bundle).TOOLCHAIN
variable with the path to your android.toolchain.cmake.armeabi-v7a
, arm64-v8a
, x86
and x86_64
.MIN_SDK
value, the minimum supported is 16
.PROJECT_PATH
variable according to your Android project path.libdlib.so
to your project,lib_opencv4.so
to your project.CMakeLists
like this one.build.gradle
(app) file in order to support CMake example.A complete tutorial is available here.
On my github you can find here, a complete Android application that uses Dlib and OpenCV 4.
Inside the folder prebuilt
you can find a set of ready-to-use libdlib.so
, compiled from Dlib 19.16 source code.
The .so
are built for the ABIs: armeabi-v7a
, arm64-v8a
, x86
and x86_64
; with a 16 as min-sdk
.
For Windows users: If the PowerShell complains about the script you can try this:
1. Open the Windows PowerShell
2. Move to the script location
3. type and execute: powershell -ExecutionPolicy ByPass -File setup.ps1
Bash script NOT TESTED!!