What does Android ndk bring?

Source: Internet
Author: User
1. Preface

6Month26,Google AndroidReleasedNdk, Aroused the interest of many developers.NdkFull name:Native Development Kit. Is: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: Ndk Before release, Android Not Supported C Development

In Google Searching "Ndk" , Many "Android Available at last C ++ Development " And so on. This is a pair Android Misunderstanding of platform programming methods. In fact, Android Since its birth, the platform has supported C , C ++ Development. As we all know, Android Of SDK Based on Java Implementation, which means that Android SDK All third-party applications for development must use Java Language. But this is not equivalent " Third-party applications can only use Java" . In Android SDK At the first release, Google It claims that its Virtual Machine Dalvik Supported JNI Programming method, that is, third-party applications can use JNI Call your own C Dynamic library, that is, in Android On the platform, "Java + C" The programming method is always possible.

Of course, this misunderstanding is rooted in:Android SDK No JNI Help. Even if third-party application developers use JNI Completed your own C Dynamic Link Library ( So ) Development, So How to integrate with ApplicationsProgramPackage them together APK And publish? There are also technical barriers. I used to spend a lot of time installing the cross compiler to create So And pass Asset (Resource) method to realize bundling So Release. However, this method can only be a clever one, not officially supported. Therefore Ndk Before coming out, we will "Java + C" The development mode of is called the gray mode, that is, the official does not declare " This method is supported. " And does not declare " This method is not supported " .

2.2 misunderstanding 2: Yes Ndk , We can use pure C Development Android Application

Android SDKUse Java Language release, putting a large number C Developers are excluded from third-party Application Development ( Note: all of our discussions are based on " Third-party Application Development " , Android System Based Linux System-level development is certainly supported C Language. ). Ndk Many people may mistakenly think, similar Symbian , Wm , In Android The platform can finally use pure C , C ++ Develop third-party applications! Otherwise, Ndk The document clearly states: It is not a good way . Because Ndk No support for system event processing or application lifecycle maintenance is provided. In addition Ndk Application UI Aspect API Is not provided. At least for the moment, use pure C , C ++ The conditions for developing a complete application are incomplete.

 

3. ndk What is

PairNdkAfter a rough study"NdkWhat is"Is as follows:

1. ndkIs a collection of tools.

  • ndk provides a series of tools to help developers develop quickly C (or C ++ ) dynamic library, SO and JAVA package applications together into APK . These tools are of great help to developers.
  • ndk integrates with the cross compiler and provides the MK file isolation CPU , platform, ABI , developers only need to modify MK file (pointed out " which files need to be compiled " , " compilation feature requirements " ) to create SO .
  • NdkYou can automaticallySoAndJavaApplication packaging greatly reduces developers' packaging work.

2. ndkProvides a stable and limited functionAPIHeader file declaration.

Google Explicitly declare this API It is stable and supports the current release in all subsequent versions. API . From this version Ndk See, these API The supported functions are very limited, including: C Standard Library ( Libc ), Standard Math Library ( Libm ), Compressed Library ( Libz ), Log Library ( Liblog ).

 

 

4. ndk What does it bring?

1. ndkTo make"Java + C"Finally, the development method has become officially supported.

    • use ndk , we can use the application logic that requires high performance C development improves application execution efficiency.
    • use ndk , we can use the application logic that requires confidentiality C development. After all, JAVA All packages can be decompiled.
    • ndk promotes professionalism SO component vendors appear. (Optimistic conjecture, depending on Android Number of users)

2. ndkYesAndroidPlatform supportCThe beginning of development.

Ndk Provides a collection of development tools for developers to easily develop and release C Component. At the same time, Google Commitment in Ndk Upgrade in later versions " Adjustable " Capability, that is, remote GDB Tools, so that we can easily debug C Source code. In Support Android Platform C Development, we can feel Google We spent a lot of energy and we have a reason to look forward to it. "C" Component support " Just Google Android Platform C The beginning of development. After all, C Programmers are still the absolute main force in the coding camp. Android In addition to application development, it is obviously not conducive Android The platform is prosperous.

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.