Build Android + NDK development environment in Windows (JDK [8u45] + Eclipse + Android SDK [r24.1.2] + ADT + NDK [r10d]) and ndk8u45

Source: Internet
Author: User
Tags virtual environment

Build Android + NDK development environment in Windows (JDK [8u45] + Eclipse + Android SDK [r24.1.2] + ADT + NDK [r10d]) and ndk8u45

1. Build an Android Development Environment 1. Install JDK.(1) Introduction: JDK, Java Development Kit, is a Java software Development Kit. JRE, namely, Java Runtime Environment, is the Java Runtime Environment and is intended for Java users rather than developers.
(2) download: click on the link (oracle )), select the target system, and download jdk-8u45-windows-i586.exe.

(3) installation: Double-click to install the program. The installation directory set when the program is just installed is the JDK installation directory, and the JRE installation directory needs to be set midway through. To differentiate, I installed JDK IN THE D: \ ProgramFiles \ Java \ jdk1.8.0 _ 45 directory and installed JRE in D: \ ProgramFiles \ Java \ jre1.8.0 _ 45 (you need to manually create the jre1.8.0 _ 45 folder) directory. After installation, you must configure three environment variables:

JAVA_HOME: JDK installation directory, that is, D: \ ProgramFiles \ Java \ jdk1.8.0 _ 45

PATH: % JAVA_HOME % \ bin

CLASSPATH: % JAVA_HOME % \ bin;.; % JAVA_HOME % \ lib \ rt. jar; % JAVA_HOME % \ lib \ tools. jar

(4) Check: Enter java-version on the console. If the java version is displayed, the installation is successful.

2. Install Eclipse.(1) Introduction: Eclipse is a Java-based scalable development platform with development source code.
(2) download: Click to open the Link (Eclipse official website). You need to download the Eclipse IDE for Java connector. What I download is eclipse-java-luna-sr2-win32.zip.

(3) installation: idea creates a shortcut to the desktop. I decompress the shortcut under the D: \ ProgramFiles \ Java directory, and the Eclipse installation directory is D: \ ProgramFiles \ Java \ eclipse.


3. Install the Android SDK.(1) Introduction: The Android SDK provides the API library required for developing Android applications and the development tools required for building, testing, and debugging Android applications.
(2) download: click "open link" ("android 网)") to use the agent server. The downloaded file is installer_r24.1.2-windows.exe.

(3) installation: Double-click to install it. I installed it in the D: \ ProgramFiles \ Java \ Android_SDK directory. After installation, you must configure two environment variables:

SDK_HOME: SDK installation directory, that is, D: \ ProgramFiles \ Java \ Android_SDK

PATH: % SDK_HOME % \ tools

(4) Update: Open SDK Manager.exe under the installation directory and select the desired version to update the SDK. Note that the proxy server is required here. This step takes a long time.



4. Install the ADT plug-in.

(1) Introduction: ADT is a development tool for Android in Eclipse. It is a plug-in for Eclipse. ADT associates Eclipse with the Android SDK.

(2) Install: Open Eclipse, select Install New Software... under the Help menu, and click Add in the window that opens. You can enter the Name as needed. The Location is region. Note that the proxy server is required here.



5. Install the Chinese plug-in.

If you are not familiar with the English Development Environment at the beginning, you can download the Chinese ins. The installation method is similar to ADT, where the Name can be entered at will, and the Location is Simplified Language Pack for eclipse in Chinese (Simplified). After installation, Eclipse restarts.


2. Establish an NDK Development Environment1. Install Android NDK.

(1) Introduction: NDK, Native Development Kit, provides a series of tools to help developers quickly develop C or C ++ dynamic libraries, the so and java applications can be automatically packaged into an apk.

(2) download: Click to open the Link (Android official website). Note that a proxy server is required here. The downloaded file is android-ndk-r10d-windows-x86.exe.

(3) installation: place the downloaded file in the directory to be installed and decompress it. The program will automatically decompress it to a folder. I decompress under the D: \ ProgramFiles \ Java directory, and finally the NDK installation directory is D: \ ProgramFiles \ Java \ android-ndk-r10d. After installation, you must configure two environment variables:

NDK_ROOT: NDK installation directory, namely D: \ ProgramFiles \ Java \ android-ndk-r10d

PATH: % NDK_ROOT %

Open Eclipse, select Perferences under the Window menu, select NDK under Android in the Window that opens, and set NDK Loaction to the installation directory of NDK, that is, D: \ ProgramFiles \ Java \ android-ndk-r10d, save and close.


2. load test cases.

(1) load the Project: Open the Eclipse software, select New> Other under the File menu, and select Android> Android Project from Existing Code in the pop-up window, in the displayed dialog box, select the path of hello-jni, that is, D: \ ProgramFiles \ Java \ android-ndk-r10d \ samples \ hello-jni. Click Finish to load the project.


(2) New Builder: Right-click the project name HelloJni, select Properties, select Builders in the displayed window, and click New to create a New Builders. For subsequent configuration options, see:


Under the Main tab:


Under the Refresh tab:


Under the Build Options tab:


Click OK to start compilation. The project compilation information is as follows:


(3) create a Test Virtual Machine: To intuitively see the running effect of the program, we need to create a virtual machine. Under the Windows menu, select Android Virtual Device Manager and click Create in the pop-up dialog box to Create a new Virtual environment. My parameter configuration is as follows:


(4) Run the program: Right-click the project name and choose Run As> Android Application. The following window appears:


= ==================================

1. Summary of all installed software:


2. References:

Http://www.cnblogs.com/baronzhao/archive/2012/07/10/2585173.html

Http://www.cnblogs.com/zwj911112/p/4238131.html? Utm_source = tuicool

Http://www.cnblogs.com/xiaomiao/archive/2012/02/20/2360308.html

Http://www.cnblogs.com/xiaomiao/archive/2012/02/21/2361929.html

Http://www.cnblogs.com/zoupeiyang/p/4034517.html

3. the installer I used: Click the open link.

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.