IBunny
IBunny

Reputation: 319

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

I'm new to android development. I read few articles about android. But I don't understand correctly what is the different between android and android NDK. What we have to do when we are using android NDK other than normal android development resources?

Upvotes: 5

Views: 6420

Answers (2)

DreemKiller
DreemKiller

Reputation: 114

Android applications by default are written in Java, compiled to byte code, which is then interpreted by the target platform and converted to it's machine code. Thus, normal android applications are relatively portable across platforms. Native Android applications (or more precisely, native sections of Android applications) are written in C and compiled directly to the machine code of a specific platform. This means that the NDK section of the application is less portable, unless you compile it specifically for every different instruction set. Why would anyone use NDK, you may ask? It's much faster for certain functions. For example, string tokenization is hideously slow in normal Android applications. Using the NDK speeds it up dramatically.

If you're asking, you should probably start with normal Android applications. If you find you need performance improvements, then you might want to get into NDK developemnt.

Upvotes: 7

peter.petrov
peter.petrov

Reputation: 39457

"The NDK is a toolset that allows you to implement parts
of your app using native-code languages such as C and C++".
The word here is about apps which are in Java for Android OS
but parts of which you want to code in a native language.

http://developer.android.com/tools/sdk/ndk/index.html

Android SDK you use when you want to write in Java for Android OS. Java is
not native as it does not directly translate to machine code but to VM bytecode.

https://developer.android.com/sdk/index.html

Upvotes: 1

Related Questions