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
-
First, unzip the compressed packages of eclipse and android SDK without installation.
-
Enter eclipse, select help->Install New SoftWare.
-
Click the add button, enter http://dl-ssl.google.com/android/eclipse/ and OK.
-
Then eclipse will automatically recognize the android plugin. Click next twice to continue.
-
Then select I accept the terms of the license agreement and continue. Then the system will automatically install the android plugin.
-
Finally, the system will prompt you to restart eclipse, you can confirm.
-
After entering eclipse again, select window->preferences. Then select the directory where android is located and confirm.
-
Then select window->Android sdk and avd manage, the following interface appears.
-
Select update all, the following interface appears.
-
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.
-
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.
-
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.
-
After this, the android environment of eclipse is configured. The following will explain the android project.
-
After entering eclipse, select file->new->other, the following interface appears.
-
Select the Android Project project and click the Next button to enter the following interface.
-
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.
-
Here's how to debug:
After the project is developed, right-click the project and select Run as -> Run Configuration. The following interface appears:
-
Click Browse and select the project you want to run. Then select Target to switch to the following interface.
-
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.
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.