Android Development Notes

Source: Internet
Author: User

First, theAndroid Architecture

1.1 Architecture

Bottom-up Layer Overview:

Linux kernel layer:

The main role of this layer is: management of the system such as: drive management, power management, process management, security management, memory management and so on.

Hardware Abstraction Layer:

The main function of this layer is: to shield the Linux Bottom implementation, provide interface upward, the layer is not open source, mainly in order to maintain the interests of merchants, but will affect the performance of the system

Android support for hardware is divided into two tiers: one is User space, the other is kernel space,

The user space is the hardware abstraction layer, which provides specific access details

The kernel space is theLinux driver, which simply provides simple hardware access logic ( the kernel driver has basic hardware information )

Native Library with Android Runtime:

This layer is the primary function: Native repository: Mainly based on c , c++ some native components, such as webkit browser engine, ssl Internet security protocol, etc. android java Core library and Span style= "' font-family:" "Times New Roman"; >DVM The two together android the operating environment.

application framework Layer: The main function of this layer is to provide android api api The corresponding development, it is also the use of java language implementation.

The layers are:activitymanager ( activity Management ), WindowManager,contentprovider, Viewsystem , Notificationmanager (message Management) package management ..

Application layer:

This layer is the main function of the third party development according to the API provided by the application box , which also contains some self-contained applications such as: Picture management, contacts, etc.

Second, theandroid-sdk directory structure

2.1 Structure Layering:

1 Add-ons: third-party libraries, such as camera drivers

2 Build-tools: build tool that contains the main tools:

Aapt.exe ( convert package to . apk file )

Dx.bat( converting a class bytecode file to a classes.dex file)

3 Platforems: This directory contains the version of the Android system, with the data and system images included in the version

4 Platforems-tools: This directory contains adb.exe (Android debug Birge) The main role of the tool is:Linux and window is a bridge for communication.

5 system-image: This directory contains images created by the Android emulator

6.tools: the tools included in this directory are:ddms.exe (DVM Debug Monitoring Service )

Sqlite3.exe(sqlite3 database Launcher) and simulator launcher, etc.

Iii. common points and differences between the JVM and the DVM

Common denominator: Execution of all bytecode files

Different points:

The structure of the program is different: theJVM performs the following:. class file

DVM executes:. Dex Files

Architecture differs:JVM performs stack-based (memory)

DVM performs register-based (CPU)

Iv. introduction of Android Application Architecture

Android applications are comprised of four components:Activity,service,broadcastreceiver , ContentProvider; each component is a separate module with a different entry for each component , Android The framework enters into the application through these portals and the components are Androidmanifest.xml files to achieve loose coupling between different components to define the overall functionality in the application.

Five, Android application running Process

1. Compiling

Java (. Class) multiple -------dx.ba tools ------>classes.dex ( one )---- Aapt.exe tool ------>.apk file --->> signature (single Signature ) is the debug signature by default

2. Installation

1. Install the . apk file into the emulator or the real machine, in the data/data

2. get the response component, permissions, package name, etc. in the androidmanifest.xml file

3. Create a folder in the data/data file, the package name is the name of the folder

4. Write application information to the data/system/package.xml file for registration of application components

3. Start

1.android Application: android linux system, once the application installation is successful, android userid userid (UI) .

Vi. Brief description of the relationship between activity,window, andview

Activity:

Activity: One of the four components that shows an interface to interact with the user

How does activity interact with the user?

Activity is a window display through the built-in Windows object that is displayed through the View To capture the corresponding event, passing the delivery message via windowmanagerservice ( the component used by the user, and the type of the component ) , in accordance with the message Android The framework callbacks the corresponding listening methods, thus enabling interaction with the user .

Window:

It represents a window, the activity 's main window, each window has a view, as the top-level view of the window, generally called the decorative view ,window Displays the layout by adding the files in the layout to the adornment view through setcontentview .

View:

Views: View is the base class for all components, and it shows a base class on the screen, the main function of view is:1, responsible for rendering of space graphics (display) 2, capture of events

The system provides a large number of standard interface components

You can also call view directly, but you need to inherit the customization of the view implementation component .

The relationship between the three is: when the activity starts,theactivity interacts with it, and the window is displayed through the built -in Windows object. The window object invokes view, which acts as the top-level view of the setcontentview The interaction with the user is achieved by adding components from the layout to the top-level view.

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.