Construction of the Android JNI development environment

Source: Internet
Author: User

In a few steps:

1. Installing Cygwin

2. Configure NDK Environment variables

3. Using the NDK to compile the program <---here Wakao becomes the *.so file, then the NDK development environment is well-equipped

4.

1. Installing Cygwin

Download Package Cygwin2.738.zip Http://dl8.cr173.com/soft1/cygwin2.738.zip

Note When installing cygwin2.738, note the point, reference: http://blog.csdn.net/zhangrongde/article/details/9372487

To check if the installation was successful: Cygcheck-c Cygwin

2. Configure NDK Environment variables

Reference: http://www.cnblogs.com/jdksummer/articles/2166057.html

First of all, my nkd directory, D:\ndkr10

Next, my Cygwin directory, D:\cygwin, contains a directory, cygdrive

Open cygwin\home\administrator\.bash_profile, add NDK variables,

ndk=/cygdrive/d/ndkr10

Export Ndkhome

Note: ndkhome name any

Open Cygwin, enter the CD $NDK, if the output

Indicates that the environment variable is set successfully.

3. Using the NDK to compile the program

Reference: http://www.cnblogs.com/jdksummer/articles/2166057.html

Open Cygwin, enter $NDK/ndk-build

Find compilation warning, check

To change the example teapot, make sure that the program under which you are compiling () Androidmanifest.xml has a version number greater than

<uses-SDK        android:minsdkversion="one"        android: Targetsdkversion=" />" ...

Enter $NDK/ndk-build, recompile, go to D:\ndkr10\samples\Teapot\libs\armeabi-v7a

Libteapotnativeactivity.so

Here, the NDK environment is well-equipped.

Construction of the Android JNI development environment

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.