What does Android ndk bring ???

Source: Internet
Author: User
From: http://blog.csdn.net/hhao137/archive/2009/06/28/4304664.aspx

1. Preface
In June 26, Google Android released ndk, which aroused the interest of many developers. Ndk stands for Native Development Kit. Http://developer.android.com/sdk/ndk/1.5_r1/index.html.

2. misunderstanding
In addition to surprises, new things will also bring us some confusion and misunderstanding.

2.1 misunderstanding 1: Android does not support C development before ndk is released
Search for "ndk" in Google, and many titles such as "android can finally use C ++ development" are a misunderstanding of Android platform programming methods. In fact, since its birth, the Android platform has supported C and C ++ development. As we all know, Android sdks are implemented based on Java, which means that third-party applications developed based on Android sdks must use the Java language. However, this is not equivalent to "third-party applications can only use Java ". At the first release of the android SDK, Google declared that its virtual machine Dalvik supports the JNI programming method, that is, third-party applications can call their own C dynamic library through JNI, that is, on the Android platform, the "Java + C" programming method can always be implemented.

Of course, the root cause of this misunderstanding is that no JNI help can be found in the android SDK documentation. Even if third-party application developers use JNI to complete their own C dynamic link library (SO) developmentProgramPackage it into APK and publish it together? There are also technical barriers. I used to spend a lot of time installing the cross compiler to create so and use the asset (Resource) method to implement the bundled so release. However, this method can only be a clever one, not officially supported. Therefore, before ndk came out, we called the "Java + C" development model the gray model, that is, the official does not declare that "this method is supported ", this method is not supported ".

2.2 misunderstanding 2: With ndk, we can use pure C to develop Android applications
Android SDK is released in Java and many c developers are excluded from third-party Application Development (Note: All our discussions are based on "third-party Application Development", and Android is based on Linux, system-level development must support C language .). Many people may mistakenly think that, similar to Symbian and WM, the Android platform can finally use pure C and C ++ to develop third-party applications! Otherwise, the ndk document clearly states that it is not a good way. Because ndk does not support various system event processing and does not provide application lifecycle maintenance. In addition, the application UI APIs are not provided in the ndk released this time. At least currently, the conditions for developing a complete application using pure C and C ++ are incomplete.

 

3. What is ndk?
After a rough study of ndk, I understand "What Is ndk" 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 applications into APK together. These tools are of great help to developers.
Ndk integrates with the cross compiler and provides MK files to isolate differences such as CPU, platform, and Abi, developers can create so simply by modifying the MK file (indicating "which files need to be compiled" and "Compilation feature requirements.
Ndk can automatically package so and Java applications, greatly reducing developers' packaging work.
2. ndk provides a stable and functional API header file statement.

Google explicitly states that this API is stable and supports the currently released API in all subsequent versions. From the ndk version, we can see that these Apis support very limited functions, including: C standard library (libc), standard Math Library (libm), and compression library (libz), log Library (liblog ).

 

 

4. What does ndk bring?
1. With the release of ndk, the development method of "Java + C" has finally become an official supported development method.

With ndk, we can use C to develop high-performance application logic, thus improving the application execution efficiency.
With ndk, we can use C to develop the application logic that requires confidentiality. After all, Java packages can be decompiled.
Ndk promotes the emergence of professional so component vendors. (Optimistic conjecture depends on the number of Android users)
2. ndk will be the start of C development on the Android platform.

Ndk provides a collection of development tools, allowing developers to easily develop and release C components. At the same time, Google promises to improve the "adjustable" capability in subsequent ndk versions, that is, to provide remote GDB tools, so that we can easily debug the C source code. With support for C development on the Android platform, we can feel that Google has spent a lot of energy. We have reason to think that "C component support" is just the beginning of C development on the Google Android platform. After all, C programmers are still the absolute main force in the coding camp. Excluding these Members from Android Application Development is obviously not conducive to the prosperity of the Android platform.

 

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/hhao137/archive/2009/06/28/4304664.aspx

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.