Java – What is the difference between android and native android (Android NDK)?

What is the difference between android and native android (Android NDK)?… here is a solution to the problem.

What is the difference between android and native android (Android NDK)?

I’m new to Android development. I read several articles about Android. But I didn’t properly understand the difference between android and android NDK. What do we have to do when we use the android NDK instead of regular android development resources?

Solution

By default, Android applications are written in Java, compiled to bytecode, then interpreted by the target platform and converted to machine code. As a result, normal Android apps are relatively portable across platforms.
Native Android applications (or more accurately, the native part of Android applications) are written in C and compiled directly into platform-specific machine code. This means that the NDK portion of your application is less portable unless you compile it specifically for each different instruction set.
You might ask, why would anyone use NDK? For some features, it is much faster. For example, string tokenization is very slow in normal Android applications. Using the NDK can speed things up significantly.

If you’re asking, you should probably start with a regular Android app. If you see a need to improve performance, then you might want to get into NDK development.

Related Problems and Solutions