Build an android Development Environment

Source: Internet
Author: User

the development of Android is in full swing, and the development is not very busy now. Now I have learned how to set up the android development environment in windows, which is a record for myself, for more information, see new entry!
(1) install JDK, omitted.
(2) download and configure the android SDK.
click environment> advanced to modify the PATH variable under system variables, add the real path of the SDK tools to it (that is, the tool path under the folder after Android SDK decompression here I am D: \ android-sdk_r04-windows \ 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.
(3) install myeclipse . I use 6.5. Other versions should be similar. The installation steps are omitted.
(4) install ADT (Android development tools ).
Start myeclipse and choose help> Software Updates> Find and install> search for new features to install-> new remote site from the navigation menu. enter name: anroid (whatever you want) URL: https://dl-ssl.google.com/android/eclipse /. OK! Select, and then install. After installation, restart myeclipse.
(5) configure the SDK path in myeclipse
choose windows> preferences> Android and select the location of the android SDK. I decompress the package in D: \ Android-
sdk_r04-windows \ Android-SDK-windows here, choose here.

(6) Create AVD (Android virtual device ).
The platforms directory for the downloaded 2.1 SDK is empty, so when cmd enters the D: \ android-sdk_r04-windows \ Android-SDK-Windows \ tools directory, the available Android targets obtained by running the android list target command (which can obtain available Virtual Devices for Android) is empty. You need to install it yourself and use myeclipse to help you. Choose WINDOW> Android SDK and AVD Manager> available packages. In the tree on the right, select the required SDK platform and the corresponding Android APIs. Here I select the latest version 2.1, and then install select. :

After installation, choose Window> Android SDK and AVD Manager> vitual devices, click New on the right, and enter as required. Name: android21 (required when starting the simulator) Target: Android 2.1-API level 7 (other versions can be selected here, provided that you have updated all of them! I can only select this one here), SD card: Enter the size you want. You can use other methods by default. After that, click Create AVD. Then, go to the D: \ android-sdk_r04-windows \ Android-SDK-Windows \ tools directory under the command line, enter the android list target command to get available Android targets there is something.
(7) Start the simulator.
CMD to D: \ android-sdk_r04-windows \ Android-SDK-Windows \ tools, enter the command: emulator-AVD android21. This is what you used
OK. You can see the simulator!

(8)ProgramWonderful World: Hello World
Learning new things is indispensable!

8.1 create a new Android Project
Open eclipse and select File> New> project. If the android Eclipse plug-in is correctly installed, an "android" item is displayed in the pop-up dialog box. Select "android project" and click Next.
8.2 fill in the detailed information of the project.
In addition to the package name, we can fill in helloworld. The activity name entered here is the class name of the activity after your project is created.
8.3 after the package is created, the project will automatically generate a helloworld class, locate helloworld under the package you just created, and modify it as follows:
Public class helloworld extends activity {
/** Called after the activity is created for the first time */
@ Override
Public void oncreate (bundle savedinstancestate ){
Super. oncreate (savedinstancestate );
Textview TV = new textview (this );
TV. settext ("Hello, world! ");
Setcontentview (TV );
}
}
When importing a package, you can use the shortcut key Ctrl + Shift + O.
8.4 run your Hello world.
Choose run>-> open run dialog. Double-click the Android Application to create a new application, And Then browse and select your application helloworld on the right side. Then 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!
This article is transferred from Www.35java.com

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.