0

I am trying to use the Android Studio1.3.2 + NDK + Windows7 to build a C++ code. I have referred the existing C++ code from the NDK samples (HelloGL2). I have compiled and run the sample codes from the NDK.

However, my problems are:-

1] I haven't found any documentation which explains how to build a C++ project for Android Studio + NDK from scratch.

2] I am unable to find a way how to modify/add .cpp files to the existing HelloGL2 example.

I have also referred to links/videos pertaining to NDK development, but none clearly explains how to use the NDK for C++ development.

https://software.intel.com/en-us/videos/building-ndk-apps-with-android-studio

http://developer.android.com/ndk/guides/android_mk.html

https://sdgsystems.com/blog/using-android-ndk-android-studio-part-1

Any help regarding this would be much appreciated. Thanks,

Abhishek.

2

1 Answer 1

1

Currently, the documentation for ndk support for Android Studio is very limited. If you are looking to build shared libraries, the links you have posted above are useful. Android studio compiles the code for you and you can even step through code and debug and even step between Java and JNI code using the Hybrid debugger. If you are looking to create a PIE (Position Independent Executable), that is an executable file that can be deployed on your android shell in user mode, then I would suggest using ndk-build with Android.mk file. This tutorial is pretty helpful for that:

https://rathodpratik.wordpress.com/2013/03/24/build-cc-executables-for-android-using-ndk/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.