Android应用基础-外文翻译

上传人:桔**** 文档编号:489672326 上传时间:2023-03-24 格式:DOC 页数:20 大小:251KB
返回 下载 相关 举报
Android应用基础-外文翻译_第1页
第1页 / 共20页
Android应用基础-外文翻译_第2页
第2页 / 共20页
Android应用基础-外文翻译_第3页
第3页 / 共20页
Android应用基础-外文翻译_第4页
第4页 / 共20页
Android应用基础-外文翻译_第5页
第5页 / 共20页
点击查看更多>>
资源描述

《Android应用基础-外文翻译》由会员分享,可在线阅读,更多相关《Android应用基础-外文翻译(20页珍藏版)》请在金锄头文库上搜索。

1、Android Application FundamentalsAndroid applications are written in the Java programming language. The Android SDK tools compile the code along with any data and resource files into an Android package, an archive file with an .apk suffix. All the code in a single .apk file is considered to be one ap

2、plication and is the file that Android-powered devices use to install the application.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

3、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),

4、so an applications 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 applications components need to be executed, then shuts down the process when its no longer needed or when the system must recover

5、 memory for other applications.In this way, the Android system implements the principle of least privilege. That is, each application, by default, has access only to the components that it requires to do its work and no more. This creates a very secure environment in which an application cannot acce

6、ss parts of the system for which it is not given permission.However, there are ways for an application to share data with other applications and for an application to access system services:Its possible to arrange for two applications to share the same Linux user ID, in which case they are able to a

7、ccess each others 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 u

8、sers contacts, SMS messages, the mountable storage (SD card), camera, Bluetooth, and more. All application permissions must be granted by the user at install time.第 1 页,共 20页That covers the basics regarding how an Android application exists within the system. The rest of this document introduces you

9、 to:The core framework components that define your application.The manifest file in which you declare components and required device features for your application.Resources that are separate from the application code and allow your application to gracefully optimize its behavior for a variety of dev

10、ice configurations.Application ComponentsApplication components are the essential building blocks of an Androidapplication. Each component is a different point through which the system canenter your application. Not all components are actual entry points for the userand some depend on each other, bu

11、t each one exists as its own entity and plays aspecific role each one is a unique building block that helps define yourapplications overall behavior.There are four different types of application components. Each type serves a distinct purpose and has a distinct lifecycle that defines how the compone

12、nt is created and destroyed.Here are the four types of application components:ActivitiesAn 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

13、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

14、 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 and you can learn more about it in the Activities developer guide.ServicesA service is a component that runs in the background to per

15、form 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第 2 页,共 20页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 ofService and you can learn more about it in the Services developer guide.Content providersA content provider

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 幼儿/小学教育 > 幼儿教育

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号