`
heteronomy
  • 浏览: 5769 次
  • 来自: 广州
社区版块
存档分类
最新评论

Android Overview

阅读更多

 

Application Fundamentals

 

Once installed on a device, each Android application lives in its own security sandbox:

 

  • The Android operating system is a multi-user Linux system in which each application is a different user.

  • By default, the system assigns each application a unique Linux user ID (the ID is used only by the system and is unknown to the application). The system sets permissions for all the files in an application so that only the user ID assigned to that application can access them.

  • Each process has its own virtual machine (VM), so an application's code runs in isolation from other applications.

  • By default, every application runs in its own Linux process. Android starts the process when any of the application's components need to be executed, then shuts down the process when it's no longer needed or when the system must recover memory for other applications.

    However, there are ways for an application to share data with other applications and for an application to access system services:

 

  • It's possible to arrange for two applications to share the same Linux user ID, in which case they are able to access each other's files. To conserve system resources, applications with the same user ID can also arrange to run in the same Linux process and share the same VM (the applications must also be signed with the same certificate).

  • An application can request permission to access device data such as the user's contacts, SMS messages, the mountable storage (SD card), camera, Bluetooth, and more. All application permissions must be granted by the user at install time.

 

 Application Components

 

There are four different types of application components. Each type serves a distinct purpose and has a distinct lifecycle that defines how the component is created and destroyed. They are:

 

Activities

 

An activity represents a single screen with a user interface. For example, an email application might have one activity that shows a list of new emails, another activity to compose an email, and another activity for reading emails. Although the activities work together to form a cohesive user experience in the email application, each one is independent of the others. As such, a different application can start any one of these activities (if the email application allows it). For example, a camera application can start the activity in the email application that composes new mail, in order for the user to share a picture.

 

An activity is implemented as a subclass of Activity.

 

Services

 

A service is a component that runs in the background to perform long-running operations or to perform work for remote processes. A service does not provide a user interface. For example, a service might play music in the background while the user is in a different application, or it might fetch data over the network without blocking user interaction with an activity. Another component, such as an activity, can start the service and let it run or bind to it in order to interact with it. A service is implemented as a subclass of Class Service.

 

Content providers

 

A content provider manages a shared set of application data. You can store the data in the file system, an SQLite database, on the web, or any other persistent storage location your application can access. Through the content provider, other applications can query or even modify the data (if the content provider allows it). For example, the Android system provides a content provider that manages the user's contact information. As such, any application with the proper permissions can query part of the content provider (such as ContactsContract.Data) to read and write information about a particular person.

 

Content providers are also useful for reading and writing data that is private to your application and not shared.

 

A content provider is implemented as a subclass of ContentProvider and must implement a standard set of APIs that enable other applications to perform transactions.

 

Broadcast receivers

 

A broadcast receiver is a component that responds to system-wide broadcast announcements. Many broadcasts originate from the system—for example, a broadcast announcing that the screen has turned off, the battery is low, or a picture was captured. Applications can also initiate broadcasts—for example, to let other applications know that some data has been downloaded to the device and is available for them to use. Although broadcast receivers don't display a user interface, they may create a status bar notification to alert the user when a broadcast event occurs. More commonly, though, a broadcast receiver is just a "gateway" to other components and is intended to do a very minimal amount of work. For instance, it might initiate a service to perform some work based on the event.

 

A broadcast receiver is implemented as a subclass of BroadcastReceiver and each broadcast is delivered as an Intent object.

 

Three of the four component types—activities, services, and broadcast receivers—are activated by an asynchronous message called an intent. Intents bind individual components to each other at runtime, whether the component belongs to your application or another. For activities and services, an intent defines the action to perform (for example, to "view" or "send" something) and may specify the URI of the data to act on. For broadcast receivers, the intent simply defines the announcement being broadcast (for example, a broadcast to indicate the device battery is low includes only a known action string that indicates "battery is low"). However, The other component type, content provider, is not activated by intents. Rather, it is activated when targeted by a request from a ContentResolver. The content resolver handles all direct transactions with the content provider so that the component that's performing transactions with the provider doesn't need to and instead calls methods on the ContentResolver object. This leaves a layer of abstraction between the content provider and the component requesting information (for security).

 

 Manifest File

 

The literal meaning of manifest is a document listing the cargo, passengers, and crew of a ship, aircraft, or vehicle for the use of customs and other officials. Android introduces this concept to the software world. So before the Android system can start an application component, the system must know that the component exists by reading the application's AndroidManifest.xml file (the "manifest" file). Your application must declare all its components in this file, which must be at the root of the application project directory.

 

Declaring components

 

The manifest does a number of things in addition to declaring the application's components, such as:

 

  • Identify any user permissions the application requires, such as Internet access or read-access to the user's contacts.

  • Declare the minimum API Level required by the application, based on which APIs the application uses.

  • Declare hardware and software features used or required by the application, such as a camera, bluetooth services, or a multitouch screen.

  • API libraries the application needs to be linked against (other than the Android framework APIs), such as the Google Maps library.

  • And more

 

Declaring component capabilities

 

Declaring application requirements

 

Here are some of the important device characteristics that you should consider as you design and develop your application:

 

  1. Screen size and density

  2. Input configurations

  3. Device features

  4. Platform Version

 

Application Resources

 

An Android application is composed of more than just code—it requires resources that are separate from the source code, such as images, audio files, and anything relating to the visual presentation of the application.

 

分享到:
评论

相关推荐

    NCSU Android Overview-Install-Application

    Android Platform Overview (1) Android Installation Guide (2) Android Application Model (3) © Frank Mueller & Seokyong Hong (TA) North Carolina State University Center for Efficient, Secure and ...

    Activity概览屏幕(Overview Screen)的demo代码

    Activity概览屏幕(Overview Screen)在Android开发中扮演着重要的角色,它通常被用来展示应用中的最近使用或重要任务,让用户能够快速切换到之前的工作状态。在这个特定的demo代码中,我们将深入探讨如何在Android ...

    Android代码-android-page-curl

    Overview The android-page-curl is a 2D View which simulates a page curl effect. Without OpenGL, only the android canvas has been used, so that it can be used in any version of Android! Showcase Page ...

    Learning Android: Develop Mobile Apps Using Java and Eclipse(第二版)

    Chapter 1 Android Overview Android Overview History Android Versions Android Flavors Summary Chapter 2 Java Review Comments Data Types: Primitives and Objects Modifiers Arrays Operators Control Flow ...

    Android代码-StompProtocolAndroid

    STOMP protocol via WebSocket for Android Overview This library provide support for STOMP protocol https://stomp.github.io/ At now library works only as client for backend with support STOMP, such as ...

    Android代码-traccar-client-android

    Overview Traccar Client is an Android GPS tracking application. It can work with Traccar open source server software. Team Anton Tananaev (anton@traccar.org) License Apache License, Version 2.0 ...

    Android代码-Kotlin-Reflect-Tools-For-JVM

    OverView This is a tool library for Kotlin to use java reflect APIs in Kotlin simply method.It can modify or read the top level private visible property value in Kotlin way. Note: This tools only ...

    张泽华Android4.0的PPT

    配合《Android基础.doc》文档和《Android Overview.ppt》的视频教程,初学者可以系统地了解Android开发的基础知识,包括但不限于环境搭建、基本组件(Activity、Service、BroadcastReceiver、ContentProvider)、...

    linux_android_uefi_overview

    在这篇文章中,我们将详细介绍Linux Android UEFI的概览,这是理解Android设备开发过程中不可或缺的内容。 首先,我们需要了解UEFI是什么。UEFI是一种在启动过程中用来初始化系统硬件的软件,并且加载操作系统。它...

    张泽华老师android4.0视频的ppt课件

    【Android Overview】 Android 4.0引入了全新的Holo设计风格,这使得用户界面更加现代化,图标和控件的设计也更为统一。系统对多任务处理进行了优化,用户可以轻松地在多个应用之间切换,并通过最近使用的应用列表...

    Android4.0视频的ppt课件

    首先,Android Overview.pdf可能涵盖了Android系统的整体架构和组成部分。这包括对Android系统的四个主要层次——Linux内核、硬件抽象层(HAL)、系统运行库和应用程序框架的介绍。Linux内核提供了基础的系统服务,...

    Android代码-smart-scheduler-android

    Overview A utility library for Android to schedule one-time or periodic jobs while your app is running. Currently, Android OS supports 3 types of scheduling APIs: Handler, AlarmManager and Job...

    Android代码-hyperlog-android

    HyperLog Android Overview Log format Download Initialize Usage Get Logs in a File Push Logs Files to Remote Server Sample Testing Endpoint using RequestBin Example Testing Endpoint inside Django ...

    Android-Vulnerabilities-Overview, 关于已知Android漏洞的简要概述.zip

    Android-Vulnerabilities-Overview, 关于已知Android漏洞的简要概述 Android漏洞概述:是Android中已知安全漏洞的数据库。 将漏洞数据库分割成独立的. md 文件,得到更好。更清晰的。 当前的2016列表在这里是avaible...

    PPT和代码资源共享

    6. **Android Overview**: - **Android系统架构**:包括Linux内核、硬件抽象层、运行库、应用程序框架和应用程序。 - **Android开发环境**:如Android Studio,集成开发环境,提供代码编辑、调试、构建等功能。 ...

    android multimedia framework overview

    android多媒体框架概述(高通),主要包括MediaCodec、MediaCodec Call Flows、NuPlayer、ExoPlayer、MediaRecorder、MediaRecorder Call Flow

    linux_android_telephony_ril_overview.pdf

    Linux Android Telephony RIL Overview Linux Android Telephony RIL Overview 是 Qualcomm Technologies, Inc. 发布的一份机密文件,概述了 Android 操作系统中 Telephony 和 RIL(Radio Interface Layer)的架构...

    uefi overview

    ### UEFI概述 UEFI(统一可扩展固件接口)是一种新型的固件接口标准,旨在为操作系统与固件之间提供一个更为现代化、灵活且安全的接口。此文档由Byosoft公司提供,主要介绍了UEFI的基础概念、架构、开发环境、特定...

    Android qcril overview

    ### Android QCRIL 概览 #### 一、引言 Android QCRIL(Qualcomm Reference Implementation Library)是高通公司为基于其芯片组的Android设备提供的一个关键组件,主要负责处理与移动通信相关的功能。它作为一个...

    MSM8953-ANDROID-PERFORMANCE-OVERVIEW

    **MSM8953-ANDROID-PERFORMANCE-OVERVIEW** MSM8953是高通公司(Qualcomm Technologies, Inc.)推出的一款应用于Android设备的系统级芯片(SoC),专门针对性能进行了优化。这款芯片在设计时考虑了高效能与低功耗的...

Global site tag (gtag.js) - Google Analytics