Build an Android development environment under Eclipse

As we all know, the application layer of Android itself is based on java. And look at the moment, the most popular and the best java IDE is eclipse. However, how to build an Android development platform under eclipse?

Build an Android development environment under Eclipse
 
Build an Android development environment under Eclipse

 

 


 

Tools/Materials

  • Eclipse (any version can be used, eclipse xtext is used here)

  • java SDK (environment variables must be installed and configured, otherwise eclipse cannot run)

  • Android SDK (download from android official website)

method/step

  1. 1

    First, unzip the compressed packages of eclipse and android SDK without installation.

    Build an Android development environment under Eclipse
  2. 2

    Enter eclipse, select help->Install New SoftWare.

    Build an Android development environment under Eclipse
  3. 3

    Click the add button, enter http://dl-ssl.google.com/android/eclipse/ and OK.

    Build an Android development environment under Eclipse
  4. 4

    Then eclipse will automatically recognize the android plugin. Click next twice to continue.

    Build an Android development environment under Eclipse
    Build an Android development environment under Eclipse
  5. 5

    Then select I accept the terms of the license agreement and continue. Then the system will automatically install the android plugin.

    Build an Android development environment under Eclipse
    Build an Android development environment under Eclipse
  6. 6

    Finally, the system will prompt you to restart eclipse, you can confirm.

    Build an Android development environment under Eclipse
  7. 7

    After entering eclipse again, select window->preferences. Then select the directory where android is located and confirm.

    Build an Android development environment under Eclipse
  8. 8

    Then select window->Android sdk and avd manage, the following interface appears.

    Build an Android development environment under Eclipse
  9. 9

    Select update all, the following interface appears.

     

    Build an Android development environment under Eclipse
  10.  

    Then select SDK 2.1 (version 2.1 is used here), and select accept on the right. Then select samples for api 7 and select accept on the right. Finally select .install.

    Build an Android development environment under Eclipse
    Build an Android development environment under Eclipse
  11.  

    Then we have to configure the AVD (otherwise, it will not be possible to virtualize the phone): select window->Android sdk and avd manager, and then select Vitural Devices.

    Build an Android development environment under Eclipse
  12.  

    Select New to configure a new AVD: you can choose the name you want, select your android SDK version in the target, customize the size of the SD card, and then select Create AVD.

    Build an Android development environment under Eclipse
    Build an Android development environment under Eclipse
  13.  

    After this, the android environment of eclipse is configured. The following will explain the android project.

  14.  

    After entering eclipse, select file->new->other, the following interface appears.

    Build an Android development environment under Eclipse
  15.  

    Select the Android Project project and click the Next button to enter the following interface.

    Build an Android development environment under Eclipse
  16.  

    The name is customized, the application name is customized, the registration must contain more than one dot, and an integer must be entered in the min SDK version. After clicking next, you will enter the project development interface.

    Build an Android development environment under Eclipse
  17.  

    Here's how to debug:

    After the project is developed, right-click the project and select Run as -> Run Configuration. The following interface appears:

    Build an Android development environment under Eclipse
  18.  

    Click Browse and select the project you want to run. Then select Target to switch to the following interface.

     

    Build an Android development environment under Eclipse
  19.  

    Select the AVD configured earlier (check its checkbox), and then select run.

    The running environment of the project is configured, right-click the project and select run as -> Android Application to run.

    Build an Android development environment under Eclipse
    END

Precautions

  • JAVA SDK must be installed! Otherwise eclipse will have problems

  • There are two download versions of the Android SDK, one contains the specific version of the SDK, and the other contains only the upgrade tool without the specific SDK version. The latter is about 20 M, and the former is more than 70 M. But there is no problem with the upgraded version, and it works very well, so the upgraded version is used in this example.

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327043449&siteId=291194637