Android NDK Development

Source: Internet
Author: User

This article only introduces how to configure the compiling environment of android ndk in windows.

I,

1. Download the Android NDK package from the google official website. Download the package http://developer.android.com/tools/sdk/ndk/index.html#to decompress it to e:#android=android-ndk.

2. Download and install Cygwin. For windows systems, cross-Compiling is required. Therefore, a Linux simulator Cygwin must be installed. Download To http://www.cygwin.com.

3. Configure the development environment of Cygwinde NDK. By default, Cygwin is installed in the root directory of drive c and changed to c: // cygwin/home/username. The username in the bash_profile file varies according to the user name. Add the following code at the end of the. bash_profile file:

ANDROID_NDK_ROOT =/cygdrive/e/android-ndk

Export ANDROID_NDK_ROOT

The code above illustrates the directory where android ndk is located

The last step is to test whether the development environment works normally. First start Cygwin, then switch to the/build directory and run the host-setup.sh file. If

Till now, the compilation and configuration of huaning has been completed.

The android ndk installation directory contains five subdirectories.

+ Apps is the directory for saving android projects. Hello-jin and tow-libs are two examples directories that come with NDK.

+ Build saves the cross-compilation tools, compilation scripts, and configuration files.

+ Docs is the directory for saving help documents.

+ Out is a cross-compiled output directory that stores the output so files.

+ Sources is the directory for saving C/C ++ source code files. The following are the hello-jin and tow-libs subdirectories, the C/C ++ source code files required for the NDK built-in examples are respectively saved. The GNUmakfile and README. TXT files are the configuration files of the make tool and the description files of the NDK.

II,

The following steps are required for android ndk development:

1. Create an Application. mk file.

2. Create an Android Project

3. Home Android. mk File

4. Create a c source code file

5. Compile the shared library module

6. Run the Android program.

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.