I used the code in this Android Studio project when I was playing with Android Native Camera API. This sample uses Android's Native Camera API together with OpenGL to draw camera frames into a texture.
For more information see https://sisik.eu/blog/android/ndk/camera