Install and use Android 2-ndk (figure)

Source: Internet
Author: User
ArticleDirectory
    • Cygwin Installation
    • Development
    • Document
    • Debugging

You can use this SDK for C/C ++ development.CodeIs a key part.

The android ndk is a complement to the android SDK that helps you:

-Generate JNI-compatible shared libraries that can run on the android

1.5 platform (and later) running on arm CPUs.

-Copy the generated shared libraries to a proper location of your

Application Project path, so they will be automatically added to your

Final (and signed). apks

Cygwin Installation

Http://www.cygwin.com/download and installProgram

You can download the package first and then install it. download all the 1.7 GB packages. The size after installation is 5.6 GB.

Development

Command Line Compilation

Note that environment variables are set according to the "prerequisites (JDK and environment variables)" to find the cygwin and ndk directories.

Compile the ndk sample file under the cygwin command line.

IDECompiling

ADT

Http://dl-ssl.google.com/android/eclipse/

CDT

Http://download.eclipse.org/tools/cdt/releases/helios

Use the above address to install ADT and CDT online for compilation.

Note:

The following is the configuration of a specific ndk Project (hello-JNI). You need to place the builder created by ndk in the first one (the newly added builder is set to ndk_builder)

In this way, the IDE will first compile the ndk file when compiling this project.

Hello-JNI example

Compile ndkLibrary files

In eclipseOpen project [Because ndkIDEThe function is not very powerful, and CDT can be disabled., Use the above command line to compile the library]

At this time, you can integrate the tracking with the interface

Document

Android-ndk-r5 \ docs can see the document, including make file format, file structure and so on can see

Debugging

Ndk debugging is currently weak. You can use the CDT or Visual Studio debugging library file.

Reference: http://zhoujianghai.javaeye.com/blog/897212

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.