Build in WindowsFor Android 2.2The development environment is the content to be introduced in this article, mainly to understand and learnFor Android 2.2Environment setup content, detailsFor Android 2.2Here is a detailed description of the content.
Google officially released the new version of its smartphone operating system, Android 2.2 Code: "Froyo" frozen yogurt ). 11 new features are also very promising for many Android enthusiasts. Here we will introduce you to the latest installation and configuration tutorials.
(1) download jdk6 and install jdkat at http://java.sun.com/javase/downloads/index.jsp. After installation, set the environment variable JAVA_HOME to the jdk installation directory and add % JAVA_HOME %/bin to the system Path variable.
(2) download and configure the Android 2.2 SDK.
You can. Configure the SDK. on a Windows machine, right-click my computer and choose Properties> advanced. Click "environment variables" to modify the Path variable under "system variables, add the real path of SDKtools to the path of the tool in the folder decompressed by Androidsdk. Here I am D: \ program \ android-sdk-windows \ tools ). After the command is added, run the android -- help command in the command line. If the android help command is displayed, the configuration is complete.
To be precise, what we just installed is not the Android 2.2 SDK, but the SDK updates and downloads the manager SDKtools. Android 2.2 SDK is not installed. Open sdksetup.exe and install the components shown in. Install at least one SDKplatform. If not, you cannot create an avd vm.
(3) download and install Eclipse3.5. Download it at http://www.eclipse.org.
(4) install ADT (AndroidDevelopmentTools ).
Start Eclipse and choose Help> InstallNewSoftware from the navigation menu. In workwith, enter https://dlssl.google.com/android/eclipse/and click add. Enter name: ADT ). Select, and then install. After installation, restart Eclipse.
Configure the SDK path in Eclipse. Choose Windows> Preferences> Android and select the location of the Android 2.2 SDK. I decompress the package in D: \ program \ android-sdk-windows \, and select here.
(5) Create AVD (AndroidVirtualDevice ).
Choose Window> AndroidSDKandAVDManager> VirtualDevices, click Add, and select android 2.2. Enter as required. Name: a2.2 (required when starting the simulator) Target: android 2.2 (other versions can be selected here, provided that you have updated all of them! I can only select this one here), SDCard: Enter the size you want. You can use other methods by default. After that, click CreateAVD.
(6) Start the simulator.
Cmd enter D: \ program \ android-sdk-windows \ tools, enter the command: emulator-avda2.2. The name you just mentioned is used here. Wait about 2 minutes to see the simulator!
(7) Create an Android 2.2 Project
Open Eclipse and select File> New> Project. If the Eclipse plug-in of Android 2.2 is correctly installed, an "Android" item is displayed in the pop-up dialog box. Select "AndroidProject" and click Next.
In addition to the package name, we can fill in HelloWorld. The Activityname entered here is the class name of the Activity after your project is created.
After creation, the project will automatically generate a HelloWorld class, find HelloWorld under the package you just created, and modify it as follows:
- Public class HelloWorld extendsActivity {
- /** Called after the activity is created for the first time */
- @ Override
- Public void onCreate (Bundle save dInstance State ){
- Super. onCreate (savedInstanceState );
- TextViewtv = newTextView (this );
- TV. setText ("Hello, World! ");
- SetContentView (TV );
- }
- }
When importing a package, you can use the shortcut key Ctrl + Shift + o.
Run your HelloWorld.
Choose Run>-> OpenRunDialog. Double-click AndroidApplication to create a new application. Then, browse and select your application HelloWorld on the right side, and Run it decisively. OK. After a while (the simulator starts a little time), you will see Hello, World! Now. There are a lot of learning examples in the SDK. Once you get started, you can start to learn more by referring to the application in the Sample!
Summary:
Build in WindowsFor Android 2.2The content of the development environment has been introduced.For Android 2.2Learning Environment Building content can be helpful to you!