Dev Guide_Android Basics_Application Fundamenta

(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 .apk suffix. 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开启了进程,当不再需要,或者必须为其他应用程序回收内存时,关闭了进程。

未完待续。。。

 

你可能感兴趣的:(android,dev,guide,docs文档翻译)