Android Development (1)

Source: Internet
Author: User

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:

    1. ADB devices list of all connected devices
    2. ADB reset restart ADB's Debug bridge
    3. adb kill-server kills ADB debug bridge
    4. Start-server start adb Debug bridge
    5. ADB Install xxx.apk Installer
    6. ADB install< Package name >
    7. ADB shell comes to phone command line terminal interface

Directory structure of the Android project:

    1. The src file contains the. Java Code
    2. Gen file is the Eclipse auto-generated code, do not easily change which R file?
    3. Android 4.1.2 represents the Android version used by the current compilation
    4. Several drawable under Res files are Android icons at different resolutions
    5. Layout file, layout file can be modified manually, or can be modified by. xml file
    6. The values below have a strings.xml containing the string, which Android invokes by creating an ID for the string.
    7. Androidmainfest.xml inside can change the permissions and many other functions, it is unclear

4 Ways to click events

    1. Create an inner class
    2. Create a Click event with an anonymous inner class
    3. Interface for activity to implement click events (most commonly used)
    4. 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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.