Android development environment built with Hello World

Source: Internet
Author: User

Hello World

Here, the environment is not a problem to build.

Next, create an Android Hello world.

1. Add an Android virtual device

Click the virtual Device Management icon directly or window-->android virtual Appliance Manager


Click "New" to add


2. Build an Android app


3. Do nothing, run directly


4. Running Results


5. Click on the application page to develop and install the first Android app.



6. Click Myfirstapp


There are two basic ways to build a UI for Android: 1), the program hard-coded; 2), XML-based layout construction; program Hard Coding method: Open Helloandroid.java and modify the program code as follows:

 Packagecom.Example.helloandroid;ImportAndroid.app.Activity;ImportAndroid.OS.Bundle; import  android. Widgets . TextView ; Public class helloandroid extends Activity {   /** Called when the activity is first created. * /   @Override    Public voidonCreate(Bundlesavedinstancestate) {       Super.onCreate(savedinstancestate);       TextViewTV= New TextView( This);TV.SetText("Hello, Android");Setcontentview(TV);   }}
DescriptionThe Helloandroid class inherits the base class activity (Android System Class). Activity is the main entry class for the application, and it can contain some column behaviors and actions. An app typically contains multiple activity, but the user interacts with only one activity at a time. The OnCreate method, which is called by the Android system at initialization time, is used to complete all initialization and UI behavior. Activity does not enforce the implementation of the user interface, but it usually contains UI implementations.



Android development environment built with Hello World

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.