there are tool to package the C code to shared library so that it can be used in android environment
This video is about how to use the Dlib with OpenCV, OpenCV for receiving image from phone camera and then pass it to Dlib format to detect by HOG for ex.
In order to use ndk-build in ubuntu
add the NDK tool to environment path by
and check that added link if it was added or not