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