Android SDK+ECLIPSE+ADT+CDT+NDK development environment built under windows 7

Source: Internet
Author: User

Android SDK+ECLIPSE+ADT+CDT+NDK development environment built under windows 7


These days have been working on the Android SDK C + + platform build, despite previous successes in Windows XP, because there was no useful record, spent a lot of wronged time,
Write it today for future use. Since both the Android SDK and Eclipse are written in Java, you'll need to install the JDK on Windows 7 before you can do it:
Http://www.oracle.com/technetwork/java/javase/downloads/index.html Select the appropriate version to download the installation.


Platform construction can be divided into two major strides:

First, set up a good Android Sdk+eclipse+adt environment, this in the network, a lot of introduction, step by step to generally do not have problems, here is a brief introduction:
1, install the Android SDK package, here is: http://developer.android.com/sdk/index.html The site has been harmonious, domestic friends may need to FQ,
When downloading, pay attention to download the corresponding version.
2. Locate the SDK Manager boot in the program directory that was installed in the previous step, and on the main interface of the Android SDK and AVD Manager,
Then select Available Packages ", click the" > "icon in front of Android repository to expand the options.
Select Android SDK platform-tools,revision 2,sdk Platform android 2.3.1, API 9,revision 2,samples for SDK API 9,revision 1 on top dialog box, click the "Install Selected" button,
Then in the pop-up Choose Packages to Install dialog box, select the "Accept All" Radio box, click on the "Install" button, will enter the download process, download speed depends on your Internet connection, please wait patiently download completed.
When the download is complete, a dialog box pops up asking if you want to restart ADB, click Yes to restart.
Then create the Android emulator and click on the "New ..." button, which will pop up the "Create New androidvirtual Device (AVD)" dialog box;
In the pop-up dialog box, enter the name in: Android-avd,target: Android 2.3.1-api level 9,SD card box input 512, other options by default, click the "Create AVD" button, Wait a moment and the Android emulator window will pop up.
3, install the Eclipse integrated development environment, visit the following address download eclipse:http://www.eclipse.org/downloads/Select the appropriate version of the download select Eclipse IDE for Java developers version.
4. Install Android Development Tools plugin, visit URL http://developer.android.com/sdk/eclipse-adt.html#installing, find ADT on Web page Download the link to download it, download and unzip to?? Install in the Eclipse directory
5. Configure eclipse, click on the Window menu on the Eclipse main screen, select Preferences, in the Preferences dialog box, select "Android" on the left, and click the Brower button on the right side of the SDK location. Select the installation path for the SDK.


Now that you can create an Android project on Eclipse, we'll build a new Android project HelloMini6410 to verify that the development environment is successful.
On the Eclipse Main screen, select menu: File->new->project ... As shown in the following:
In the New Project dialog box that appears, select: Android->android project,
Then click on the "Next" button, the interface will pop up the "New Android Project" dialog box, in the dialog box to enter the following:
1) in Project name, enter: HelloMini6410
2) Build Target select: Android 2.3.1 check box
3) appication name input: HelloMini6410
4) in Package name, enter: com.mini6410
5) Create activity input: mainactivity
As shown, after the input is complete, simply click the "Finish" button to complete the New Project Wizard, which will return to the main interface:
Click Welcome the X button to close the Welcome screen and start the drawing view
Click on the left of Src->com.mini6410, Mainactivity.java to see the source code:
To compile and ship the HELLOMINI6410 program, first select the HELLOMINI6410 project name in the Package explorer and click on the Run->run as->android application on the toolbar.
will automatically start the Android emulator, the boot process because the need to start the Android system, so be patient, after the Android system starts, it will be automatically shipped HelloMini6410 program.

This allows you to develop a Java-based application under the Eclipse IDE. The next step will be to talk about how to add C + + functionality to the Eclipse IDE, which is the focus of this article.


Second, create the Android NDK development environment.

To develop the NDK on the Windows platform, you need to install Cygwin (a software that simulates Linux on the Windows platform), about the Cygwin installation is more complex, if the initial installation is likely not successful, you can refer to the article, here only:/http www.cygwin.com/
1, install the Android NDK, can go to Androna network download: http://developer.android.com/sdk/ndk/index.html Note Select the appropriate version of the download, download it after the decompression can be.
2, configuration Cygwin, with Utriaedit open Cygwin installation directory home/< your user name >/.bach-profile file, in the back add
NDK=/CYGDRIVE/&LT;NDK Installation path >
Export NDK
Two lines, you can also add environment variables under Windows $NDK =&LT;NDK installation path >.
3. To install the CDT plugin, the CDT is a plug-in that enables Eclipse to support C + +. This is: http://www.eclipse.org/cdt/downloads.php can be installed through the Help > Install New software in Eclipse,
Now, go to the Help–install New software menu item, add an item: Cdt-http://download.eclipse.org/tools/cdt/releases/helios, wait for the update project tree to load,
Then select the Eclipse C + + development Tools under the programming languages Branch,
Then click on the Next button, follow the prompts, accept the default options, and finally you must accept the license in order for Eclipse to complete the update.
When you're done, you'll see a prompt to restart Eclipse, click the Yes button, and wait for Eclipse to restart. Now your eclipse supports C + +.
4. Configuration of Eclipse
Right click on your project, pick properties.
Select "Builders" from the left-hand list.
Click "New ..." on the right side.
Select "Program" as the configuration type.
I name Mine "Native Builder"
Location-c:\cygwin\bin\bash.exe
Working Directory-c:\cygwin\bin
Arguments-
(For NDK R3):
--login-c "Cd/cygdrive/c/android_ndk && make App=myapp"
(For NDK R4):
--login-c "cd/cygdrive/c/<myapp_project_dir> &&/cygdrive/c/android_ndk/ndk-build"
Make sure your hyphens before login and the quotes after the hyphen-c
Now go to the Refresh tab
Check "Refresh Resources upon completion"
Select "Specific Resources"
Click on the "Specify Resources" button and select your project ' s lib directory.
Check "recursively include sub-folders"
Now go to the Build Options tab
Check "Allocate Console"
Check "Launch in Background"
Check "Run the builder after a clean"
Check "Run the builder During manual builds"
Check "Run the builder During Auto builds"
Check "Specify working set of relevant resources"
Click on "Specify Resources"
Select your project ' s JNI directory and all files within.
Now click OK on the bottom.
The above is a detailed configuration from: http://www.rbgrn.net/content/348-get-your-eclipse-integrated-ndk-on You can now compile and run C + + programs in the Eclipse IDE.
Now compile and run the HELLOMINI6410 program again, first select the HELLOMINI6410 project name in the package explorer,
Then click on the Run->run as->android application of the toolbar to run the emulator successfully.


A few problems encountered:
1. The following error occurred while installing CDT:
Cannot complete the install because one or more required items could not be found.
Software being installed:eclipse/C + + Remote Launch 6.0.0.201002161416 (org.eclipse.cdt.launch.remote.feature.group 6.0.0.201002161416)
Missing Requirement:eclipse/C + + Remote Launch 6.0.0.201002161416 (org.eclipse.cdt.launch.remote.feature.group 6.0.0.201002161416) requires ' Org.eclipse.rse.ui [3.0.0,4.0.0] ' but it could wasn't be found
The Final Solution: Download the C + + version of Eclipse to copy all jar files under the plugin directory to the plugin directory in the Java version of the Eclipse installation directory.
When copying, note that if the existing is skipped, reinstalling the CDT problem no longer occurs, and why it is unclear why this is to be done.

Reference article:
1. Installing the SDK http://developer.android.com/sdk/installing.html
2. Download the Android NDK http://developer.android.com/sdk/ndk/index.html
3. ADT Plugin for Eclipse http://developer.android.com/sdk/eclipse-adt.html
4, Get Your eclipse-integrated NDK on! Http://www.rbgrn.net/content/348-get-your-eclipse-integrated-ndk-on
5. Android beginners:ndk Setup Step by step http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/

Android SDK+ECLIPSE+ADT+CDT+NDK development environment built under windows 7

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.