I. Build an Android App project
1. Running Eclipse.exe
2. See
3. Enter the interface
4. Enter the app, project, package name
5. Select the workspace path that the project establishes;
6. Configure features such as icons and backgrounds
7. Select the Activity's page format
8. Set the corresponding name
9. Build the Project
Two. Project Introduction
1. The interface can use the tool to drag the control by dragging. Graphical interface development environment.
2. Code format for interface layout
3.mainactivity.java main program structure code and view bindings
3. Code Mainactivity.java
Package Com.example.helloworld;import Android.os.bundle;import Android.app.activity;import android.view.Menu; public class Mainactivity extends Activity { @Override protected void onCreate (Bundle savedinstancestate) { super.oncreate (savedinstancestate); Setcontentview (R.layout.activity_main); } @Override Public Boolean oncreateoptionsmenu (Menu menu) { //Inflate the menu, this adds items to the Action bar I F it is present. Getmenuinflater (). Inflate (R.menu.main, menu); return true; } }
4. Code Activity_main.xml
<relativelayout xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:tools= "http// Schemas.android.com/tools " android:layout_width=" match_parent " android:layout_height=" Match_parent " android:paddingbottom= "@dimen/activity_vertical_margin" android:paddingleft= "@dimen/activity_ Horizontal_margin " android:paddingright=" @dimen/activity_horizontal_margin " android:paddingtop=" @dimen /activity_vertical_margin " tools:context=". Mainactivity "> <textview android:layout_width=" wrap_content " android:layout_height=" Wrap_ Content " android:text=" @string/hello_world "/></relativelayout>
5. Code Main.xml
<menu xmlns:android= "Http://schemas.android.com/apk/res/android" > <item android:id= "@+id/ Action_settings " android:orderincategory=" " android:showasaction=" never " android:title=" @string /action_settings "/></menu>
Three. Project Operation
1. Run the project
2. Start the ADT Simulator, Android phone simulation software. After running, automatically start ADT
3. Run the interface
4. Click Configure Run interface
Step-by-step diagram to develop the first Android project and run the See graphics Android---Android Development example tutorial two