Search code examples
androidandroid-studioandroid-ndkndk-build

Confusions in NDK samples


I am a beginner to Android NDK with Android Studio. While trying to grasp the ideas through tutorials I got my self very confused. Mainly I am confused about the building method of native project.

For example while following this tutorial, when I build the project there is no file created inside libs project. Moreover, there is no need of Android.mk and Application.mk make files also.

However, second tutorial deals with the make file.

Can anyone please explain to me step by step explanation of build steps. I am not sure how hard it is for Android team to make a simple tutorial explanation one version of built.


Solution

  • Not sure, if by the time of this writing (2016/02/01 - Android Studio 2.0 Preview 9) NDK is officially supported yet, but it's surely been under development. That's the reason of using Eclipse+ADT+NDK in the official guide as you can see in the Setup section. I believe, once the process is done, the documentation will be updated.

    You're free to choose which approach to use:

    • Eclipse+ADT+NDK or
    • Android Studio + Gradle + NDK

    With the second approach Gradle generates *.mk files automatically, although you can use your own files by preventing the auto-generation as per The new NDK support in Android Studio by ph0b.