1. Development needs environment
Need to go to Google to download ADT, and ECLIPSE,JDK. The ADT is then loaded as an Eclipse plug-in.
2. Introduction to Android Project structure
SRC-Storing code files
Gen-xml and code transfer files are generated automatically by the program. No need to modify
Assets-Resources Directory
Bin-Output directory, no need to modify
Androidmanifest.xml-The overall configuration file
3. Basic structure of Android application
Application-Broadest scope
Activity-the control of a single view, the transfer of information between activity requires the help of application. Scope under Application
Final start application which one to use, the activity entrance with which. The Androidmanifest.xml configuration is complete.
4. View-based Hellow World program
4.1 Creating an empty Android project
4.2 Create a layout XML file under Res-layout as a configuration for view placement. Then drag a button up
4.3 The displayed view is then set under the default activity, as well as the button content bindings.
Packagecom. hont.learn2;Importandroid.app.Activity;ImportAndroid.os.Bundle;ImportAndroid.view.View;ImportAndroid.widget.Button; Public classLearn2activityextendsActivity {/**Called when the activity is first created.*/@Override Public voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); Setcontentview (r.layout.mylayout); FinalButton button = (Button) This. Findviewbyid (R.id.button1); Button.setonclicklistener (NewView.onclicklistener () { Public voidOnClick (View v) {//TODO auto-generated Method StubButton.setheight (Button.getheight () +5); } }); }}
4.4 This time, the button will be higher for each click.
Android Development Learning 1