I don't want to mess around with Android Studio
, which seems very complex and disorganized (compared to Xcode
or Visual Studio
anyway). I don't understand or care to know why only Android Studio
has 3 or 4 project file types. I just want to compile from the command line, using a Makefile
, and I'm coding in C++
for NDK
. How is this done?
Asked
Active
Viewed 1,313 times
4

Jon Goodwin
- 9,053
- 5
- 35
- 54

ndk
- 327
- 2
- 6
-
1The Android NDK is only for building native libraries, not applications. you still need the external framework to package your library for installation and to call your library. The Android development tools have command line applications to do most of the above but not easily. Start reading here: https://developer.android.com/ndk/guides/ – Richard Critten Apr 27 '18 at 13:19
-
3First for general (**no** `Android Studio`) android development see [this](https://stackoverflow.com/questions/47167769/hello-world-android-app-with-as-few-files-as-possible-no-ide-and-text-editor/47251607#47251607). For the `NDK` library building part, [Apache Ant](https://stackoverflow.com/questions/47167769/hello-world-android-app-with-as-few-files-as-possible-no-ide-and-text-editor/47251607#47251607) "`it can also be used effectively to build non Java applications, for instance C or C++ applications.`" By the way you **CAN** build an app totally in c++(**no** `Java`, I've done it!) – Jon Goodwin Apr 27 '18 at 13:41
-
@RichardCritten I'm coding in C++ not Java. – ndk Apr 27 '18 at 14:03
-
@JonGoodwin Do you have a primer on how you did it? The sample NDK programs from Google all include lots of Java. My goal is to do OpenGL. – ndk Apr 27 '18 at 14:04
-
It was a `samples` app in an old `NDK` (release 9, hmmm samples seem missing from release 16, ;O() called [native-activity](https://developer.android.com/reference/android/app/NativeActivity) "`Convenience for implementing an activity that will be implemented purely in native code. That is, a game (or game-like thing). There is no need to derive from this class; you can simply declare it in your manifest, and use the NDK APIs from there. `" .Might be useful if you say your OS (Windows, Linux...) 32 bit or 64 bit etc... – Jon Goodwin Apr 27 '18 at 14:26
-
First of all welcome to `StackOverflow`. Your first day, your first question (**first points**). As a new user this site can be a bit *intimidating*. (we have quite strict quality control, unlike other sites). Be prepared for **brutal analysis** of your questions ! Please take a moment to see the site [**tour**](https://stackoverflow.com/tour),(you get a badge for looking at it!). – Jon Goodwin Apr 27 '18 at 16:06
-
Remember to vote (a lot) on things you **like** or **dislike**, it's important for **quality control**. If you have a complaint, refer it to the **moderators** (**flag**). If you want to message some one use the @ symbol and their username (I am @Jon Goodwin). Mark question as Answered if it have been Answered to your satisfaction. Enjoy StackOverflow. Happy hunting. – Jon Goodwin Apr 27 '18 at 16:06
-
1@JonGoodwin Android Native Activity is a Java framework class that has defined calls for the Android Events into a C/C++ stub that you then had to flesh-out with your own code. You were still running under control of Java. See: https://developer.android.com/reference/android/app/NativeActivity Link to the sample is on the above page. – Richard Critten Apr 27 '18 at 16:18
-
The built app has **no** java SRC directory not one line of user java source code. Build the example and see ;o) – Jon Goodwin Apr 27 '18 at 17:04
-
@JonGoodwin I know, it's is calling the C/C++ from the Java framework code. Basically the native activity (both Java and C/C++) is a glue layer, patching together the 2 languages via both JNI and pipes. So the Java is still there in the framework code that hosts the NDK module. – Richard Critten Apr 27 '18 at 19:11
-
Your missing the point that both I and the OP have made. – Jon Goodwin Apr 27 '18 at 20:00