(1. Preface?? On June 26, Google Android released NDK, which attracted many developers. Full name of NDK: NativeDevelopmentKit. The download address is: developer.android/sdk/ndk/1.5_ r1/index. html。 2. Misunderstandings?? In addition to surprises, new things will also bring us some inducements and misunderstandings. 2.1 Misunderstanding 1: Android does not support C development before the NDK is released?? Look up "NDK" in Google, and many titles like "Android can finally be developed using C ", which is a misunderstanding of Android platform programming methods. Originally, the Android platform has supported C and C development since its birth. As we all know, the Android SDK is implemented based on Java, which means that third parties who develop based on the Android SDK must use the Java language. But this is not the same as "the third party can only use Java". When the Android SDK was first released, Google claimed that its virtual machine Dalvik supports JNI programming methods, that is, third parties can call their own C dynamic library through JNI, that is, on the Android platform, the "Java C" programming method is always possible.?? Of course, this misunderstanding is rooted in the fact that no JNI help can be found in the Android SDK documentation. Even though the third-party developers use JNI to implement their own C dynamic link library (so) development, how can so be packaged into an apk and released together with the user program? There are also technical barriers. In the past, I spent a lot of time installing the interposition compiler to create so, and using the asset method to achieve bundled so release. However, this method can only be attributed to ingenuity, not official support. Therefore, before the NDK came out, we called the "Java C" development mode as the gray mode, that is, the official statement neither "support this method" nor "do not support this method". 2.2 Misunderstanding 2: With NDK, we can use pure C to develop Android?? The Android SDK is released in the Java language, which excludes many C developers from third-party use and development. (Note: All our comments are based on "third-party use and development". The Android system is based on Linux, and system level development must support the C language.). With the release of NDK, many people will mistakenly believe that, similar to Symbian and WM, it is finally possible to use pure C and C to develop third-party applications on the Android platform! Otherwise, the NDK document clearly states that it is not a tool way. Because NDK does not provide various system event management support, nor does it provide application lifecycle protection. In addition, in the NDK released this time, the API for user UI is not provided. At least for now, the conditions for developing a complete use of pure C and C are not complete. 3. What is NDK After a general study of NDK, my understanding of "what is NDK" is as follows: 1. NDK is a collection of tools. NDK provides a series of tools to help developers quickly develop C (or C ) dynamic libraries, and can automatically package so and java together into apks. These tools can help developers endlessly. NDK integrates the interposition compiler and provides the corresponding mk files to block the differences between CPU, platform, ABI, etc. Developers only need to simply repair the mk files (point out "which files need to be compiled", "compilation feature requests", etc.) to create so. NDK can automatically package so and Java together, greatly reducing the packaging work of developers. 2. NDK provides a stable and limited API header file declaration.?? Google clearly states that the API is stable and supports the API released at that time in all subsequent versions. From this version of NDK, we can see that the functions supported by these APIs are very limited, including the C specification library (libc), the specification math library (libm), the compression library (libz), and the Log library (liblog). 4. What does NDK bring? 1. The release of NDK has finally turned the "Java C" development method into an official supported development method. With NDK, we can use C to develop the use logic for high performance requests, thus improving the performance of the user program. With NDK, we can use C to develop the confidential usage logic. After all, Java packages can be decompiled. NDK promotes the emergence of professional so component manufacturers. (Da Guan guesses that it depends on the number of Android users) 2. NDK will be the initial stage for Android platform to support C development.?? NDK provides a collection of development tools that enable developers to quickly develop and publish C components. Together, Google promises to improve the "adjustable" ability in the subsequent versions of NDK, that is, to provide remote gdb tools so that we can quickly debug C source code. In supporting C development on the Android platform, we can feel that Google has spent a lot of energy. We have reason to be fascinated that "C component support" is only the initial stage of C development on the Google Android platform. After all, C programmers are still code farmers)