Android installation configuration and simple output HelloWorld

Source: Internet
Author: User

First, installation configuration

1. Software Download:

(1) Open the Web page, search http://pan.baidu.com into Baidu Cloud, login Baidu account (account number: 15567067134 password: qs19941025). After entering, there is an Android app folder, double-click to enter, there is an Android tool and JDK, and then double-click into the two folders, the contents of everything in the download. (preferably downloaded to the same folder for later use)

2. Installation:

(2) Unzip eclipse into the Eclipse folder and open Eclipse. Save to an open disk (preferably with a previously downloaded file for later use). After opening, turn off the Welcome interface (if there are other interfaces, also turn it off) into the interface, and then load the Atd,sdk file.

(3) help->install->add->archive->adt (find previously downloaded ADT) Click Open , then select Developer Tools, Remove the check mark from the bottom contact and do not update . then keep next until the installation is complete and agree to restart Eclipse.

(4) After restarting,window-> the last preferences-> to the right of the browse (Find the SDK file downloaded before, load into the inside), select the following Android4.0->ok. Then click Window->avd manager->new->name (for example: Android4.0)->target (must choose Android4.0)->creat avd-> Select the newly created Avd->start->launch (run), so , the phone's analog interface appears.

Second, simple output HelloWorld

(1) New project:

Upper-left corner file->new->android project (if not, select Project->android->android project)->next->project Name (to the project name, can only be in English, it is recommended to write abbreviated project names, for example: HW, for later use)->next->android4.0->next->application name (English and Chinese can, for example: Hello World, The analog interface will be displayed)->package Name (must have more than two logos, for example: Com.cvit), and finish, so that the project we have created.

(2) Create a new XML document:

on the left appears our new project, double-click Open. Find res->layout-> Right-->new->other->android->android XML layout File (Create a new XML document)- >file (naming the document, for example, HW)->finish, so that the XML document is created and used to write program code.

(3) Write code:

after completing the second step, you will see a new XML document appears in layout, double-click to enter, and click Hw.xml below to edit the content . Add HelloWorld code before the end of the original code

<textview
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
android:layout_margintop= "50DP"
android:layout_marginleft= "25DP"
android:text= "HelloWorld"/>

Ctrl+s save it, so we're done with this program. Note that <textview/> All used angle brackets when writing code and must be used in pairs.

Third, run the program

Mouse on the creation of the project, right-->run as->android application, after the run will appear after the interface, click on the right side of the return, will find the phone interface more than a HelloWorld icon, if you want to view again, double-click the icon.

Android installation configuration and simple output HelloWorld

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.