Android development Article 1 (setup of the installation environment)

Source: Internet
Author: User

Introduction

This series is suitable for people with 0 basics, because I started from 0. This series records my experience in Android development and I hope to share it with you! As a newcomer to the android team, I hope to give you some advice if there is anything wrong.

Before starting the android development journey, you must first build an environment and then create a simple helloworld. The topic of this article is as follows:

    • 1. Establish the environment

      • 1.1 JDK Installation
      • 1.2 install eclipse
      • 1.3 Android SDK Installation
      • 1.4 ADT Installation
      • 1.5 create AVD
    • 2. helloworld
1. Establish the environment 1.1 JDK Installation

If you do not have a JDK, you can download it here. The next step is to install the SDK step by step. To set environment variables, follow these steps:

    1. Choose my computer> Properties> advanced> environment variables> system variables to add the following environment variables:
    2. Java_home: D: Program filesjavajdk1.6.0 _ 18 (Directory where you install JDK)
    3. Classpath value:.; % java_home % lib ools. jar; % java_home % libdt. jar; % java_home % in;
    4. Path: Start appending % java_home % in;
    5. Note:Setting environment variables in the previous four steps is not necessary for building an android development environment. You can skip this step.

After the installation is complete, check whether the JDK is successfully installed. Open the CMD window and enter Java-version to view the JDK version. The following figure shows that the installation is successful:

Figure 1. Verify that JDK is successfully installed

1.2 install eclipse

If you still have eclipse, you can download the Eclipse IDE for Java developers (92 m) Win 32bit version as shown in:

 

Figure 2. Eclipse download

Decompress the package and use it.

1.3 Android SDK Installation

Download android-sdk_r05-windows.zip from Android codecs and decompress it to any path.

    • Run SDK setup.exe and click available packages. If no package is available, click Settings, select "Force https: //..." In MISC, and then click available packages.
    • Select the SDK you want to install and its documentation or other packages. Click installation selected, accept all, and install accepted to download and install the selected packages.
    • In the user variable, create a path with the absolute path of tools in the android SDK (the local path is D: androiddevelopndroid-SDK-Windows ools ).

Figure 2. Set the environment variables of the android SDK

After "OK", restart the computer. After restarting the computer, enter the CMD command window and check whether the SDK is successfully installed.
If Android-H has the following output, the installation is successful:

Figure 3. Verify that the android SDK is successfully installed

1.4 ADT Installation
    • Open Eclipse IDE and choose "help"-> "install new software" from the menu"
    • Click Add.... In the displayed dialog box, enter name and location: name, and enter http://dl-ssl.google.com/android/eclipse. As shown in:

    • After the return result is confirmed, select the ADT we just added from the drop-down list after work with. We will see the developer tools below, which will show Android ddms and Android development tools, select them. As shown in:

    • Next, follow the prompts to proceed to the next step.

After completion:

    • Select WINDOW> preferences...
    • Select android on the left-side panel, Click Browse... on the right side, and select the SDK path. The local machine is:
      D: androiddevelopndroid-SDK-Windows
    • Click Apply and OK. Configuration complete.
1.5 create AVD

To enable Android applicationsProgramYou can run it on the simulator. You must create an AVD.

    • 1. In eclipse. Choose Windows> Android SDK and AVD Manager
    • 2. Click virtual devices in the left-side pane, and then click New on the right side.
    • 3. Fill in the name and select the target API. the SD card is of any size and the skin option is selected. Currently, the default value of hardware is used.
    • 4. Click Create AVD to create an AVD.

Note:If you click virtual devices in the left-side pane, and then click New on the right side, but the target drop-down list does not have any options, then you:

    • Click available packages in the left-side pane, and check https://dl-ssl.google.com/android/repository/repository.xmlon the right, as shown in:

      • Click the install selected button and then follow the prompts.

The reason for these two steps is that some necessary available packages (available packages) are not installed in 1.3 and Android SDK installation ).

2. helloworld
    • Use the file-> New-> Project menu to create a new project "android Project"
    • Then fill in the necessary parameters, as shown in: (Note that Google APIS is selected here. You can select what you like, but you need to create the corresponding AVD)

Description of related parameters:

  1. Project name: name of the folder containing the project.
  2. Package name: the package name follows the Java specification. It is important to use the package name to distinguish different classes. I use helloworld. Test.
  3. Activity name: this 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.
  4. Application name: a readable title on your application.
  5. In the "use default location" option in the "select bar", you can select an existing project.
    • Click "finish" and select "Run deployments" from the "run" menu of Eclipse...
    • Select "Android Application" and click "+" in the upper left corner (the button is like a piece of paper) or double-click "Android Application". A new option "new_configuration "(You can change it to our favorite name.).
    • On the right Android panel, Click Browse ..., Select helloworld
    • Select AVD in the target IC of the target panel,If no AVD is available, click manager in the lower right corner ..., Then create the corresponding AVD. As shown in:

    • Click the run button. If the operation succeeds, the android Simulator Interface is displayed, as shown in:

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.