Short answer: Yes you can.
Here is what you can do 1
1) In Android Studio, right-click on your module ==> New ==> Package
2) specify the cpp package (folder) (or you can name it jni )
3) you will see the cpp directory on the left.
4) You can create .cpp , .h and other files in this folder.

You should now tell gradle how to do this.
You need to install CMake . 2
1) Go to settings ==> Android SDK ==> SDK Tools ==> CMake
2) Select this and click "Apply" and "OK"

Now you need to add the CMakeLists.txt file to your project.
Path: my_project/app/CMakeLists.txt
This is what the file looks like:
# https:
And the last step: add the following to your build.gradle :
externalNativeBuild { cmake { path 'CMakeLists.txt' } }
Now you can create it.
source share