The first day is a brief introduction to the Android system.
Android Origin: Android virtual machine is Dalvak, Android is based on the development of Linux.
Development environment configuration for Android: using Eclipse development. First you need to download ADT. Then open Eclipse has an SDK manage download the desired Android version.
Eclipse Interface Description: Eclipse's main interface includes two parts, Java interface and DDMS interface, both in the upper right corner of Eclipse, you can switch after clicking. Ddms is mainly about the state of the virtual machine, if the device interface to see devices, the emulator has started, if not, go back to the Java interface, and then click on Android vitual device manage to create a simulator. If the eclipse interface changes accidentally, you can change it under Window-showview
ADB command: The downloaded ADT directory has a platform-tool file with a Adb.exe file that can be added to the environment variable. Commonly used ADB commands:
- ADB devices list of all connected devices
- ADB reset restart ADB's Debug bridge
- adb kill-server kills ADB debug bridge
- Start-server start adb Debug bridge
- ADB Install xxx.apk Installer
- ADB install< Package name >
- ADB shell comes to phone command line terminal interface
Directory structure of the Android project:
- The src file contains the. Java Code
- Gen file is the Eclipse auto-generated code, do not easily change which R file?
- Android 4.1.2 represents the Android version used by the current compilation
- Several drawable under Res files are Android icons at different resolutions
- Layout file, layout file can be modified manually, or can be modified by. xml file
- The values below have a strings.xml containing the string, which Android invokes by creating an ID for the string.
- Androidmainfest.xml inside can change the permissions and many other functions, it is unclear
4 Ways to click events
- Create an inner class
- Create a Click event with an anonymous inner class
- Interface for activity to implement click events (most commonly used)
- A way to bind a click in a layout file
Shortcut keys:
Control+1: Naming the control
Simulator if the problem can be shut down the simulator, and then to the device directory to view the status of the emulator. If a new emulator is opened each time the program is run, then the file under C:\Users\xinhu_000\.android\avd\iphone.avd may not be deleted
Toast.maketext (Context context, charsequence text, int duration) Reminders feature
Android Development (1)