Android Application Structure

Source: Internet
Author: User
Tags vector font

[Selector] Getting started with Google Android development and practices

 

This article describes the architecture of Android, the composition of Android applications, and the logical composition of Android applications.

 

1. Android Architecture

The software hierarchy of Android includes an operating system, middleware, and application. The software hierarchy can be divided:

  • Applications
  • Application Framework
  • Runtime environments of various libraries and Android
  • Operating system layer

Application: it is written in Java to Design User Interface interaction design. Android provides many core applications, such as desktops, contacts, telephones, and browsers.

 

Application Framework: Provides system APIs for applications. With the Android Application Framework, developers can reuse various components and services. Application Framework components:

  • Ui components: including lists, text boxes, buttons, and other UI components, which are visible to users.
  • Content Providers: provides a mechanism for applications to access and share data.
  • Notification MANAGER: allows the application to display its warning information on the status bar. If the application receives a new message, it prompts the battery information.
  • Activity MANAGER: manages the lifecycle of an application and provides a page exit mechanism for the application.

 

Android library and runtime environment

Android contains some core C/C ++ libraries that can be used by various components of the system through JNI technology.

These libraries include:

  • System C Library: The Standard C library inherited from BSD.
  • Media Repository: includes a variety of commonly used audio, video format playback and recording. Supports static image files, including MPEG4, MP3, AAC, JPG, PNG, H.264, and Amr.
  • Surface MANAGER: manages the display subsystem and provides seamless integration of 2D and 3D for multiple applications.
  • Libwebcore: browser engine.
  • SGL: The underlying 2D graphics engine.
  • 3D librarie: Provides 3D acceleration.
  • FreeType: Provides bitmap and vector font display.
  • SQLite: database application.

Android contains a core library that provides most of the functions of the core library of the Java language.

Every android application runs in its own process space and has an independent Dalvik virtual machine. Dalvik is designed as a device to efficiently run multiple virtual systems at the same time. The Dalvik virtual machine depends on some features of the Linux kernel, such as thread scheduling and memory management.

 

2. Composition of Android applications

The android program consists of the following four parts:

  • Activity
  • Broadcast intent receiver er
  • Server
  • Content Provider

Activity generally represents a screen on the mobile phone screen, which is equivalent to a page in the browser. Add a View to the activity to implement the application interface and user interaction. An application is generally composed of multiple activities, which can jump to each other and transmit data between pages. Each activity has its own lifecycle.

Intent extends er, which is an abstract description of the operation to be executed. With intent, you can jump between an activity and an activity. The most important component of intent is its action and data corresponding to the action ). An intent-related class is intent filters. It describes the operations that intent can use to process.

Broadcast intent receiver, used to respond to external events. Broadcastreceiver cannot generate the UI, so it is invisible to users.

Service.

Content Provider: A content provider provides a set of standard interfaces that allow applications to save or read various data types of content providers. An application can expose its own data. For external applications, it does not need to care about the data storage method. to store the data, you only need to access the data through the R interface provided by content provide. Of course, this involves data access permissions.

 

3. Android project file Composition

Android development uses eclipse + ADT.

Project files include:

  • Source File: code written in Java, including the implementation of various activities.
  • R. Java: automatically generated by ECLIPSE, including the resource ID used by the application.
  • Android Library: the android library file.
  • Assets: Place multimedia files.
  • Res: resource files, labels, animations, and colors required by the application.
    • Drawable: image resources
    • Layout: Describes the layout of an activity.
    • Values: defines strings, colors, and so on.
  • Android manifest. xml: application configuration file. Declare the application name, activity, service, receive, and permission in the file.

 

Related Article

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.