There is a feature of Android Studio to Include C++ Support which generates an external build file called CMakeLists.txt. The similar question has changes required to that file to get the C++ portion of OpenCV to compile in Android Studio.