For Making an app, Java Language is used with the IDE i.e. Eclipse integrated development Environment. NDK is a Tool Companion to the SDK. NDK Provides the header and library function that allows to make an activities. if you are Write the native code in c or c++ then the applications are packaged into a .apk file and this file only runs inside of virtual machine on the device. in the native code the fundamental application does not change. Android App Development begins with basic recipes that helps you to build native apps. The recipes cover application development with Android NDK i.e. OpenGL programming and Multimedia programming.
The use of NDK is always not beneficial because it increases the application complexity. The “enough rope” Phrase is comes to our mind. In general we should only use native code if it is essential to our application, not just because you want to program in c or c++.The NDK allows us to implement parts of app using native code in c or c++ for some type of apps. With this you can reuse the exiting codes. but most of the applications do not needs the Android NDK. Running Native code is complicated because the Android uses a Non standard C Library functions.
The use of NDK is always not beneficial because it increases the application complexity. The “enough rope” Phrase is comes to our mind. In general we should only use native code if it is essential to our application, not just because you want to program in c or c++.The NDK allows us to implement parts of app using native code in c or c++ for some type of apps. With this you can reuse the exiting codes. but most of the applications do not needs the Android NDK. Running Native code is complicated because the Android uses a Non standard C Library functions.
As a Developer we need to Maintain the Balance Between its benefits against the drawbacks. We use NDK only if it is Essential to app. When you use the Native code think about the Requirements and see that the Android Framework APIs Provide that functions which are needed In the Android Framework there are two ways to use the native code.
First way is that write your app in the android framework and then use the JNI i.e. Java Native Interface. it is used to acess the APIs that are Provided by the Android NDK.The JNI allows code to run in a Java Virtual Machine to call the library functions written in the other languages like C.
The Second Way is that Which Handles activity of lifecycle callback like oncreate(), onpause() and onresume(), in your native code. the Applications that use the native code must run on Android2.3 i.e. API Level 9.
Good Candidate For NDK are self contained, CPU intensive Operations that do not takes large amount of memory i.e. physical simulation and signal process. Running Native code is complicated because the Android uses a Non standard C Library functions.
No comments:
Post a Comment