I've been looking through a few of the apps today (was actually looking to see how many use ACRA) but noticed that a lot of them use the NDK. I've been developing apps for quite some time and have yet to find a need for the NDK and as per the Android Developer site you shouldn't really use it unless you need to:
In general, you should only use the NDK if it is essential to your app—never because you simply prefer to program in C/C++.
So this has got me to thinking... Am I missing something? I mean here are just a few of the apps using the NDK where I can't really see a need for it:
I guess my thinking is perhaps they are using the same code on other platforms, libraries written in C and used on iOS, Android & other platforms, but I'm just not convinced that this is the reason. Are there any other things that these apps are likely to be using the NDK for? Other things I guess could be: Licensing, privacy/security (move complicated reverse engineering), Device IDs, Gaming engines etc.
Anyhow, the question is really, do you have any ideas as to why so many apps are using the NDK?
The Native Development Kit (NDK) is a set of tools that allows you to use C and C++ code with Android, and provides platform libraries you can use to manage native activities and access physical device components, such as sensors and touch input.
But even if we know C or C++, how would we implement it in our app? So this is where we require NDK to integrate the native-code languages to make it run on the app. Let's see some more advantages of using NDK: It provides a way to embed the equivalent native libraries in the apk.
You really should use SDK, unless you have a good reason to use NDK. Good reasons may vary, but for example, you could use NDK: If you want to use OpenGL ES 2.0 for Android 2.1 (Eclair), it is only avaiable through NDK.
Android provides Native Development Kit (NDK) to support native development in C/C++, besides the Android Software Development Kit (Android SDK) which supports Java. [TODO] more. NDK is a complex and advanced topics.
Not sure if this question is proper for StackOveflow, but as a developer using NDK I can give you two reasons from my perspective:
very large code base in C++, which is used also for versions on iPhones and Winrt, and also Windows CE/Desktop. It was developer for years, fixed, tested by lots of users.
its harder for hackers to learn what your code is doing, and to break it. But not impossible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With