[Android Study Notes] 01-build and familiarize yourself with the android Development Environment

Source: Internet
Author: User

On the morning of October 1st, I introduced various smartphone operating systems, including Android, IOS, and windowns phone. Then I started my experiment in the afternoon.

Android development environment. The steps are not complex. It took a whole afternoon, mainly because the network speed of the data center was too slow, and the installation process could not avoid access to the Internet.

Lab 1Build and be familiarAndroidDevelopment Environment

[PURPOSE]

Build and familiarize yourself with the android development environment.

Lab requirements]

1,Configure and build an android Development Environment

2,Create a helloworld Project

3,Install and uninstall the APK file in the android simulator Environment

4,Understand the basic file directory structure of the android Project

5,Complete the experiment process]

[Experiment process]

1,

Table 1 versions of software required for Android DEVELOPMENT AND THEIR

Software name

JDK 1.6

Http://java.sun.com

Eclipse Indigo

Http://www.eclipse.org

Android SDK 2.3.3

Http://developer.android.com/sdk/index.html

ADT

Https://dl-ssl.google.com/android/eclipse/

(The above software can also be directly from http://appdev.sysu.edu.cn /~ Mad/Android download .)

2,InstallJDKAnd ConfigurationJavaDevelopment Environment

1) install JDK. The installation package contains JDK and JRE. We recommend that you install JDK on the same drive letter.

2) Set environment variables. In "my computer"> "properties"> "advanced", select "environment variables ", add the "bin" folder path in the JDK installation directory to the PATH variable name, and add the "lib" folder path in the JDK installation directory to the classpath variable name.

3) if the test is successful, click "Start> Run" and enter "cmd" to open the command line window. Enter "Java-version". If the following result is displayed, the installation is successful.

Figure 1 "Java-version" test command

3,Eclipse,SDKAndADTInstallation and configuration

6) eclipse installation is very simple. You can directly decompress the downloaded compressed package.

7) install the SDK, decompress the SDK installation package to the path where you want to install the SDK, and then run "SDK setup.exe ".

8) if the message is "failed to fetch URL ..." In the "android SDK and AVD manager" window, select "setting" on the left side, and select "Force https ://.. and run "SDK setup.exe" again ".

9) Click "available packages", select the API version and USB driver and SDK document to install, and click "Install selected" to install the software package. You can also directly extract android-sdk-windows.rar from the public mailbox to the specified path .)

10) configure the SDK. In "my computer"> "properties"> "advanced", select "environment variable ", add the path of the Tools Folder under the android SDK installation folder to the PATH variable name.

11) install ADT, start eclipse, and click "help"> "install new software..."> "Add ...", Enter the name and address "https://dl-ssl.google.com/android/eclipse/#" in the window shown in 3 /". If the prompt address is duplicate, click "available software sites". In the address list, select the same address and select "Remove" or "reload. After "Remove", add a new address according to the method in Step 11.

Figure 3 add ADT

12) after the address connection is successful, eclipse returns the window shown in 4, and the available ADT plug-ins are listed under the "name" tab. Select "selelct all" and install the ADT plug-in as prompted.

13) in Eclipse IDE, choose "window"> "Preferences"> "android" and click "Browse ...", Select the android SDK installation path and click "OK ". Open the menu option "file" and select "new"> "project". If the "android project" option is displayed, the installation and configuration are successful.

Figure 4 ADT installation package selection

Figure 5 eclipse integrated ADT plug-in

4,CreateHelloworldProject

1) Start eclipse and create a new project. Open the option "file" in the menu bar, select "new"> "project", and select the "android project" option.

Figure 6 create an android Project

2) Click "Next", enter "helloworld" in "project name", and select "android SDK 2.3.3" in the "build target" option box ", enter the application in the "Application name" text box.ProgramName "helloworld", enter the application package name "com. Examples. helloworld" in the "package name" text box, and enter the activity name "helloworldactivity" in the "Create activity" text box ".

3) Click the "finish" button. eclipse will automatically create the project. The navigation window on the left will display the project you just created. If no navigation window appears, click "window"> "show View"> "package Explorer" to display the navigation window.

4) Create an AVD (Android Virtual Device) simulator ). Click "window"> "android SDK and AVD manager", select "Virtual Devices" on the left, and click "New…" on the right ...", Create an AVD.

5) in the "name" text box, enter the AVD name "myavdtest", and select "android 2.3.3" as the API level in the "target" list ", enter the size of the SD card to be created in the "size" text box and set the simulator style in the "skin" tab.

6) run the simulator AVD. Click "run"> "Run deployments", double-click "Android Application" in the left-side Navigation Pane, and create an android project running configuration. In "name" on the right, enter the project running configuration name "helloworld". On the "android" tab, select the project to be run, which is also "helloworld ", click the "target" tab, select "automatic", and select "myavdtest" We just created in the AVD list box ".

7) Click "run" to run the helloworld project.

Figure 7 performance of the helloworld project in the simulator

Figure 8 Android Simulator Interface

Figure 9 file structure of the helloworld Project

5,SetAPKFile InstallationAndroidSimulator in progress

1) Click Start> Run and Enter cmd to open the command line window.

2) Go to the folder adb.exe under Android sdk.

3) type ADB install D: \ diving_chick_1.apk (the red part is the path of the APK file) or enter ADB install and drag the APK file to the command line window.

4) Press enter. If the information shown in Figure 6 is displayed, the APK file is successfully installed on the simulator.

Figure 10 the APK file is successfully installed on the simulator.

6,UninstallAPKFile

(The command line uninstallation method is a little cumbersome. I will not introduce it here. If you are interested, you can study it on your own. This section describes how to uninstall an APK file using a simulator .)

5) Click "Settings"> "application"> "manage applications" from the menu in the simulator ";

6) Select the application to uninstall and click "Uninstall" à "OK" to uninstall the APK file from the simulator.

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.