Eclipse configures the android development environment and eclipseandroid Development

Source: Internet
Author: User

Eclipse configures the android development environment and eclipseandroid Development

1. Configure the development environment

1. Install JDK first

Http://www.oracle.com/technetwork/java/javase/downloads/index.html
You don't have to worry about this.

2. Install Eclipse again

Http://www.eclipse.org/downloads/download.php? File =/technology/epp/downloads/release/luna/SR2/eclipse-jee-luna-SR2-win32.zip

After the JDK variable environment is configured and Eclipse is installed, if only common JAVA applications are developed, the Java development environment is ready.
To develop Android applications through Eclipse, We need to download the Android SDK (Software Development Kit) and install the ADT plug-in Eclipse: the plug-in can associate Eclipse with the Android SDK; the Android SDK provides the API library required for developing Android applications and the development tools required for building, testing, and debugging Android applications.

3. reinstall the Android SDK

Download: http://developer.android.com/sdk/index.html#Other

First: Install sdk(take installer_r24.1.2-windows.exe as an example)
Http://dl.google.com/android/installer_r24.1.2-windows.exe


Configure SDK manager (Server: mirrors.neusoft.edu.cn, port: 80)

Then download and update the SDK

Add the environment variable: absolute path of tools and platform-tools in the Android SDK.
F: \ Program Files \ Android \ android-sdk \ tools
F: \ Program Files \ Android \ android-sdk \ platform-tools
After configuration, open the command prompt (cmd) and enter the android-h and adb commands respectively. If the command is displayed, the environment variables of the Android SDK have been configured.

Type 2: Download the bundle, but as long as the sdk package is in it, the rest are the same as above

In fact, it can be used directly for Android application development, but the Eclipse tool in it is not easy to use, so I only use the sdk package in it.

4. Install ADT in eclipse

Download: https://dl.google.com/android/ADT-23.0.6.zip
In the Help menu, select Install New Software and find the local path (recommended) or online path where the ADT is stored:


After installation, confirm the sdk path in the android option in window-> preferences. If not, add:

Note: after ADT is installed, a series of android icons will appear in the menu bar. If not, either the ADT is not installed or the view is not opened: Select mimize perspective in the window menu and select the android-related view to be displayed.

5. Create and configure AVD

To enable Android applications to run on simulators, you must create an AVD (Android Virtual Device ). Click the android virtual device manager icon under the menu bar (or choose windows> android virtual device manager ):

Click the "create" button, select the Name, select the Device, set the Target parameter to the system version of the simulator, and set the Skin parameter to the screen resolution. Click OK to create a simulator. If necessary, we can create multiple simulators for testing.


So far, even if the entire development environment has been set up, android development can be performed below.

Ii. Helloworld Program

1. Create a project

Choose file> new> android application project to create a new android project.

Fill in the above three items, and select the default ones for the following four items. Click next:

It is also basically the default one here: Note that if the create activity option is selected here, you need to create and specify the activity in the subsequent steps.

2. Select the icon
The next step is to select the application icon:

Here, image is custom, clipart is the default icon of the system, and text is a text icon. Additional padding is to adjust the size, shape and color.

3. Create an activity
The next step is to create and specify an activity:


The created activity name is the main class name of the project. This class will be a subclass of the Android Activity class. An Activity class is a simple class for starting and controlling programs. It can create an interface as needed, but not required. Layout name is the Layout name. Because blank activity is selected, there is no Layout name for other elements.
Click finish.

4. Run the program
Before running, configure the running option: Right-click the project, choose run as-> run configurations, and select the configured AVD from the target option.

Right-click the project and choose run as> android application to run the program.

Iii. Common Startup errors
1. When eclipse is enabled, an error is reported: Invalid Content starting with 'd: skin' is found. Child elements should not be contained here.
Solution: http://blog.csdn.net/holybin/article/details/46994585
2. The simulator Cannot be started. The error "Cannot set up guest memory 'android _ arm ': Invalid argument" is returned.
Solution: http://blog.csdn.net/holybin/article/details/46994859

Ref: Resource download
Https://developer.android.com/sdk/index.html
Http://www.androiddevtools.cn/
Http://blog.csdn.net/shulianghan/article/details/38023959

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.