1. Build a development environment
1. Unzip the sdk.zip file (do not have Chinese in the directory)
2. Configure path
2. Create the first Android project : HelloAndroid
1. Specify the version of the sdk as 18
2. To adapt to the lower version, modify the manifest file: minsdk='8'
3. Four file directory structures
1. The composition of the application project
---src (source folder)
MainActivity.java: Main interface class
--gen (auto - generated source text folder)
R.java : corresponds to the res folder
drawble : picture
layout: layout
string : string
--res (resource folder)
drawable - xxx : image folder
In order to adapt to mobile phones with different resolutions
layout : the layout file of the interface
Functionality is similar to HTML
values : constants folder
strings.xml : Contains fixed strings, referenced in layouts:
@string/name
--AndroidManifest.xml (feature manifest file)
The composition of the Apk installation file, the application compilation and packaging process:
Android system file directory structure
SDK file directory structure
Three application development tools
ADB: Debug Tool
adb shell
adb install -r apkPath
ls
cd
cls
ctrl+c
DDMS: debug debugging tool in eclipse
Log: log tool class
size
Related APIs:
.Application Exercises :
Appearance and behavior:
1. Define the interface layout
2. Implement Activity
1). Load the layout in onCreate()
2). Query all view objects that need to be operated according to id, and save them as member variables
3). Set a listener (click) for the view object
4). Implement the response logic in the listener's callback method