查看: 1598|回复: 0
打印 上一主题 下一主题

Dev Guide_Android Basics_Application Fundamenta

[复制链接]
跳转到指定楼层
沙发
发表于 2015-3-29 10:51:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

(0)

Application Fundamentals

Android 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 .apksuffix. All the code in a single .apk file is considered to be one application and is the file that Android-powered devices use to install the application.

应用程序原理

Android 应用程序是用java语言写的。Android SDK工具把代码数据和资源文件都编译成一个以.apk为后缀的Android存档文件包。应用程序的所有代码都在一个.apk文件里,并且它可以安装在Android平台。


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.

每个安装在设备上的应用程序都运行在它自己的安全区间内:

因为Android操作系统是一个多用户的操作系统,所以每个应用程序都是一个不同的用户。

默认的,系统分配给每个应用程序一个唯一的Linux用户ID(ID只对系统使用,对应用程序不可见)。系统在一个应用程序内为所有的文件设置了权限,所以只有被分配了用户ID的应用程序才能访问它们。

每个进程有自己的虚拟机,所以每个应用程序的运行都是相互隔离的。

默认的,每个应用程序都在自己的Linux进程下运行。当应用程序的组件需要执行的时候,Android开启了进程,当不再需要,或者必须为其他应用程序回收内存时,关闭了进程。


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 加入因仑

本版积分规则

快速回复 返回顶部 返回列表