Android外文文献翻译
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
An droid Applicati on Fun dame ntals
An droid applicati ons are writte n in the Java program ming Ian guage. The An droid SDKtools compile the code—along with any data and resource files —
into an An droid package , an archive file with an .apk suffix. All the code in a single .apk file is considered to be one application and is the file that
An droid-powered devices use to in stall the applicati on.
On cei nstalled on a device, each An droid applicati on lives in its own security
san dbox:
The An droid operati ng 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 assig ned to that applicati on 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 applicati on runs in its own Linux process. An droid starts the process whe n any of the applicati on's comp onents n eed to be executed, the n shuts dow nthe process whe nit's no Ion ger n eeded or whe n the system must recover
memory for other applicatio ns.
In this way, the An droid system impleme nts the prin ciple 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 en vir onment in which an application cannot access parts of the system for which it is not given permissi on.
However, there are ways for an applicati on to share data with other
applicati ons and for an applicati on to access system services:
It's possible to arrange for two applicati ons to share the same Linux user ID, in which case they are able to access each other's files. To con serve 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 applicatio n can request permissi on to access device data such as the user's con tacts, SMS messages, the moun table storage (SD card), camera, Bluetooth, and more. All applicati on permissi ons must be gran ted by the user at in stall time.
That covers the basics regardi ng how an An droid applicati on exists withi n the system. The rest of this docume nt in troduces you to:
1、T he core framework components that define your application.
2、The manifest file in which you declare components and required device features for your applicatio n.
3、Resources that are separate from the application code and allow your application to gracefully optimize its behavior for a variety of device
con figuratio ns.
Applicati on Comp onents
Applicati on comp onents are the esse ntial build ing blocks of an An droid applicati on. Each comp onent is a differe nt point through which the system can