您的位置:首页 > 移动开发 > Android开发

android学习_应用基础

2013-10-02 01:13 218 查看
    最近刚刚搞完spring security这个框架,真是乱的不行了, 不过最后还是有一丢丢的小成就感,起码说是基本可以做了,。 然后最近又在和朋友聊移动这方面的事,就觉得移动的话,一点都不会肯定是不行的。

   然后思考了一下,学习安卓成本可能会低一点,所以。。。就看安卓吧。

   工作可能不太需要安卓,所以我就晚上多看一点,呵呵,看着玩吧。

    我和初学者是一样的, 我也特别迷茫 ,希望能给我推荐点好书什么的,容易上手的什么的,但是。。。我实在怕看完书,方向就乱了,所以,。。我决定了,还是去读官方的文档吧。

    把网址分享给大家:

   


安卓的应用基础(Application Fundamentals)

文档中这样解释安卓的安全机制的:

一旦安装到设备上,每个安卓应用都会存活在它自己的安全沙箱中:

1.Android操作系统是一个多用户的Linux系统中,每个应用程序是一个不同的用户。

2.默认情况下,系统为每个应用分配一个唯一的Linux用户ID(ID只能由系统使用,是未知的应用程序)。系统设置在应用程序中的所有文件的权限,所以只有用户ID分配给该应用程序可以访问它们。

3.每个进程都有自己的虚拟机(VM),因此应用程序的代码运行在隔离从其他应用程序。

4.默认情况下,每一个应用程序运行在自己的Linux进程。启动任何应用程序的组件需要执行的过程中,然后关闭进程时,那么系统必须恢复内存供其他应用程序。

在这种方式中,Android系统实现了最小特权原则。也就是说,默认情况下,每个应用程序只能访问组件。

不过,也有应用程序与其他应用程序共享数据和应用程序访问系统服务的方式:

1.安排两个应用程序共享相同的Linux用户ID,在这种情况下,他们能够访问对方的文件,这是可能的。为了节省系统资源,应用程序使用相同的用户ID,也可以安排在相同的Linux进程中运行,并共享相同的VM(应用程序也必须使用相同证书签署)。

2.应用程序可以请求权限访问设备数据,比如用户的联系人,短信,安装存储(SD卡),摄像头,蓝牙,多。所有应用程序必须被授予权限的用户在安装时。

今天先看到这吧。 配置环境,,就没什么好说的了,,百度一查,,基本上很快就能配好(就是下载慢啊慢啊。。。。)

看英文是我最讨厌的事了, 不过学习知识还是蛮不错的。。 

我把原文贴出来。大伙看着玩吧。。

原文:


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.

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.

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 access 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:
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.

That covers the basics regarding how an Android application exists within the system. The rest of this document introduces you 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 device configurations.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  java android