当前位置:文档之家› Android外文翻译(Android中英文献)

Android外文翻译(Android中英文献)

Android外文翻译(Android中英文献)
Android外文翻译(Android中英文献)

本科毕业设计(论文)外文参考文献译文及原文

学院信息工程学院

专业测控技术与仪器

(光机电一体化方向) 年级班别 2011级(1)班

学号

学生姓名

指导教师

2015年 6 月

目录

1应用程序基础 (1)

1.1应用程序组件 (1)

1.2激活组件:intent (3)

1.3 关闭组件 (4)

1.4manifest文件 (5)

1.5Intent过滤器 (6)

1.6基于XML的布局 (7)

1Application Fundamentals (8)

1.1 Application Components (8)

1.2Activating components:intent (11)

1.3 Shutting down components (12)

1.4 The manifest file (13)

1.5Intent filters (14)

1.6XML-Based Layout (15)

1 应用程序基础

Android应用程序使用Java编程语言开发。aapt工具把编译后的Java代码连同应用程序所需的其他数据和资源文件一起打包到一个Android包文件中,这个文件使用.apk作为扩展名。此文件是分发并安装应用程序到移动设备的载体;是用户下载到他们的设备的文件。单一.apk文件中的所有代码被认为是一个应用程序。

从多个角度来看,每个Android应用程序都存在于它自己的世界之中:

1 默认情况下,每个应用程序均运行于它自己的Linux进程中。当应用程序中的任何代码需要被执行时,Android启动此进程,而当不再需要此进程并且其它应用程序又请求系统资源时,则就关闭了这个进程。

2 每个进程都有其独有的虚拟机(VM),所以应用程序代码与所有其它应用程序代码是隔离运行的。

3 默认情况下,每个应用程序均被赋予一个唯一的Linux用户ID,并加以权限设置,使得应用程序的文件仅对此用户及此应用程序可见——尽管也有其它的方法使得这些文件同样能为其他应用程序所访问。

1.1 应用程序组件

Android的一个核心的特性就是一个应用程序可以使用其它应用程序的元素(如果那个应用程序允许的话)。例如,如果你的应用程序需要显示一个图片卷动列表,而另一个应用程序已经开发了一个合用的而又允许别的应用程序使用的话,你可以直接调用那个卷动列表来完成工作,而不用自己再开发一个。你的应用程序并没有吸纳或链接其它应用程序的代码。它只是在有需求的时候启动了其它应用程序的那个功能部分。

为达到这个目的,系统必须能够在一个应用程序的任何一部分被需要时启动一个此应用程序的进程,并将那个部分的Java对象实例化。因此,不像其它大多数系统上的应用程序,Android应用程序并没有为应用程序提供一个单独的入口点(比如说,没有main()函数),而是为系统提供了可以实例化和运行所需的必备组件。一共有四种组件类型:

(1)Activity

activity是为用户操作而展示的可视化用户界面。例如,一个activity可以展示一个菜单项列表供用户选择,戒者显示一些包含说明文字的照片。一个短消息应用程序可以包括一个用于显示要发送消息到的联系人列表的activity,一个给选定的联系人写短信的activity以及翻阅以前的短信或改变设置的其他activity。尽管它们一起组成了一个内聚的用户界面,但其中每个activity都不其它的保持独立。每一

个都实现为以Activity类为基类的子类。

一个应用程序可以只有一个activity,戒者,如刚才提到的短信应用程序那样,包含很多个。每个activity的作用,以及有多少个activity,当然是取决于应用程序及其设计的。一般情况下,总有一个应用程序被标记为用户在应用程序启动的时候第一个看到的。从一个activity转向另一个靠的是用当前的activity启动下一个。

每个activity都被给予一个默认的窗口以进行绘制。一般情况下,这个窗口是满屏的,但它也可以是一个小的位于其它窗口之上的浮动的窗口。一个activity也可以使用附加的窗口——例如,一个在activity运行过程中弹出的供用户响应的对话框,这是一个当用户选择了屏幕上特定项目后显示的必要信息的窗口。

窗口显示的可视内容是由一系列层次化view构成的,这些view均继承自View 基类。每个view均控制着窗口中一块特定的矩形区域。父级view包含并组织其子view的布局。叶节点view(位于层次结构最底端)在它们控制的矩形区域中进行绘制,并对用户直达其区域的操作做出响应。因此,view是activity与用户进行交互的界面。例如,view可以显示一个小图片,并在用户指点它的时候产生动作。Android有一些预置的view供开发者使用——包括按钮、文本域、滚动条、菜单项、复选框等等。

view的层次结构是由Activity.setContentView() 方法放入activity的窗口之中的。content view是位于层次结构根位置的View对象。(参见独立的用户界面文档以获取关于view及层次结构的更多信息。)

(2) Service

service没有可视化的用户界面,而是在一段时间内在后台运行。例如,一个service可以在用户做其它事情的时候在后台播放背景音乐、从网络上获取数据或者计算一些东西并提供给需要这个运算结果的activity使用。每个service都继承自Service基类。

一个媒体播放器播放播放列表中的曲目是一个不错的例子。播放器应用程序可能有一个或多个activity来给用户选择歌曲并进行播放。然而,音乐播放这个任务本身丌应该由任何activity来处理,因为用户的期望即使在他们离开播放器的应用程序而已经在开始做别的事情时,音乐仍然在继续播放。为达到这个目的,媒体播放器activity可以启动一个运行于后台的service服务。系统将在这个activity不再显示于屏幕后,仍维持音乐播放的service的运行。

连接至(绑定到)一个正在运行的service(如果service没有运行,则启动之)是可能的。连接之后,你可以通过那个service暴露出来的接口不service进行通讯。对于音乐service来说,这个接口可以允许用户暂停、回退、停止以及重新开始播放。

如同activity和其它的组件一样,service服务运行于应用程序进程的主线程内。

所以它不会对其它组件或者用户界面有任何的妨碍作用,它们一般会派生一个新线程来执行一些时间消耗型任务(比如音乐回放和网络下载)。参见稍后的进程和线程介绍。

(3) BroadcastReceiver

broadcast receiver是一个与注于接收广播通知信息,并做出相应处理的组件。许多广播是由系统代码产生的——例如,通知时区改变、电池电量低、拍摄了一张照片或者用户改变了语言选项。应用程序也可以发起广播——例如,通知其它应用程序一些数据已经下载到设备上并处于可用状态。

一个应用程序可以拥有任意数量的broadcast receiver,以对所有它认为重要的通知信息予以各种响应。所有的receiver均继承自BroadcastReceiver基类。

broadcast receiver没有用户界面。然而,它们可以启动一个activity或者service 来响应它们收到的信息,当然也可以使用NotificationManager来通知用户。通知可以用多种方式来吸引用户的注意力──闪动背光灯、震动设备、播放声音等等。通知一般是在状态栏上放一个持丽的图标,用户可以点击打开它并获取所要消息。

(4)Contentprovider

content provider将一些特定的应用程序数据供给其它应用程序使用处理。数据可以存储于文件系统、SQLite数据库或其它有意丿的方式。content provider继承于ContentProvider 基类,实现了一套使得其他应用程序能够检索和存储它所管理的类型数据的标准方法。然而,应用程序并不直接调用返些方法,而是使用一个ContentResolver 对象,调用它的方法作为替代。ContentResolver可以与任何content provider进行会话;与其合作对任何相关的进程间通讯进行管理。

参阅独立的Content Providers文档以获得更多关于使用content provider的信息。

每当出现一个需要被特定组件处理的请求时,Android会确保那个组件的应用程序进程处于运行状态,必要时会启动它,并确保那个组件的一个合适的实例可用,必要时会创建那个实例。

1.2激活组件:intent

当接收到ContentResolver发出的请求后,content provider被激活。而其它三种组件——activity、service和broadcast receiver,被一种叫做intent的异步消息所激活。intent是一个保存着消息内容的Intent对象。对于activity和service来说,它指明了所请求的操作名称,并指定了用来操作的数据的URI和其它一些信息。例如,它可以承载一个对一个activity的请求,让它为用户显示一张图片,或者让用户编辑一些文本。而对于broadcast receiver来说,Intent对象指明了所通报的操作。例如,它可以对所有感兴趣的对象通报照相按钮被按下。

对于每种组件来说,激活的方法也是不同的:

1 通过传递一IntentContext.startActivity()Activity.startActivityForResult(以启动(或指定新工作给)另外一个activity。相应的activity可以通过调用自身的getIntent() 方法来查看并且激活它的intent。Android通过调用activity的onNewIntent()方法来传递给它随后的任何intent。

一个activity经常启动另一个activity。如果它期望它所启动的那个activity

返回一个结果,它会调用startActivityForResult()而不是startActivity()。例如,如果它启动了另外一个activity以使用户挑选一张自己的照片,它也许想知道哪张照片被选中了。其结果将会被封装在一个Intent对象中,并传递给发出调用的activity 的onActivityResult() 方法。

2 通过传递一个Intent对象至Context.startService()以启动一个service(或向正在运行的service给出一个新的指令)。Android调用此service的onStart()方法并将Intent对象传递给它。

与此类似,一个intent可以被传递给Context.bindService()以建立一个处于调用组件和目标service乀间的活动连接。此service会通过onBind() 方法的调用来获取此Intent对象(如果此service尚未运行,bindService()会先启动它)。例如,一个activity可以建立一个不前述的音乐回放service的连接,这样它就可以提供给用户一些途径(用户界面)来控制回放。这个activity可以调用bindService()来建立此连接,然后调用service中定之的方法来控制回放。

稍后的远程方法调用一节有关于如何绑定至一个service的更多细节。

3 应用程序可以通过传递一个Intent对象至Context.sendBroadcast() ,Context. sendOrderedBroadcast(),以及Context.sendStickyBroadcast()和其它类似方法来发起一个广播。Android会调用所有对此广播有兴趣的broadcast receiver的onReceive()方法,将此intent传递给它们。

1.3 关闭组件

content provider仅在响应来自ContentResolver的请求时处于不同活动状态。而broadcast receiver仅在响应一条广播信息的时候处于各种活动状态。所以没有必要去显式地关闭这组件。

而activity则不同,它提供了用户界面。只要会话依然持续,无论会话过程有无空闲,activity同用户进行长时间会话且可能一直处于活动状态。与此相似,service 也会在很长一段时间内在后台保持运行。所以Android为关闭activity和service提供了一系列有序的方法。

activity可以通过调用自身的finish()方法来关闭。一个activity可以通过调用finishActivity()方法来关闭另外一个activity(它用startActivityForResult() 启动的)。

service可以通过调用自身的stopSelf()方法,或调用Context.stopService()

来停止。

系统也会在组件不再被使用的时候戒者当Android必须为更多的活动组件回收内存时关闭它。稍后的组件的生命的周期一节,将对这种可能性及结果进行更详细的介绍讨论。

1.4 manifest文件

当Android启动一个应用程序组件之前,它必须知道那个组件是存在的。因此,应用程序会在一个被打包到Android包中的manifest文件中声明它的组件,.apk文件还将涵括应用程序的代码、文件以及其它资源。

manifest文件是一个结构化的XML文件,而且对于所有应用程序,文件名总是AndroidManifest.xml。除了声明此应用程序各个组件,它会做很多其他工作,比如指明应用程序所需链接到的库的名称(除了默认的Android库外)以及标出应用程序期望获得的各种权限。

但manifest文件最重要的任务是向Android报告此应用程序的各个组件。丼例说明,一个activity可能声明如下:

元素的name属性指定了实现此activity的Activity子类。icon和label 属性指向包含展示给用户的此activity的图标和标签的资源文件。

其它组件也以类似的方法声明—— 元素用于声明service,

元素用于声明broadcast receiver,而 元素用于声明content provider。未在manifest文件中进行声明的activity、service以及content provider将

不为系统所见,从而也就永不会被运行。然而,broadcast receiver既可以在manifest 文件中声明,也可以在代码中动态创建(为BroadcastReceiver对象),并以调用Context.registerReceiver()的方式注册至系统。

1.5 Intent过滤器

一个Intent对象可以显式地指定一个目标组件。如果进行了返种指定,Android 会找到这个组件(基于manifest文件中的声明)并激活它。但如果intent没有显式地指定一个目标,Android就必须找到最合适的组件来响应此intent。这个过程是通过比较Intent对象和所有潜在目标的intent过滤器完成的。组件的intent过滤器会通知Android它所能处理的intent类型。如同组件的其它必要信息一样,这些intent 过滤器是在manifest文件中进行声明的。返里有一个对先前例子的扩展,其中加入了针对activity的两个intent过滤器:

示例中的第一个过滤器——action“android.intent.action.MAIN”和

category“https://www.doczj.com/doc/0218726517.html,UNCHER”的组合——是常见的一个。它标明了此activity应该在应用程序启动器中显示,就是用户在屏幕上看到的此设备上可供启动的应用程序的列表。换句话说,这个activity是应用程序的入口点,是用户在启动器中选择运行这个应用程序后所见到的第一个activity。

第二个过滤器声明了此activity在一种特定类型的数据上可以执行的操作。

一个组件可以拥有任意数量的intent过滤器,每个都声明了一套不同的功能。如果组件没有包含任何过滤器,它只能被显式地指明作为目标组件的intent激活。

对于在代码中创建并注册的broadcast receiver来说,intent过滤器将被直接实例化IntentFilter为对象。其它所有的过滤器都在manifest文件中设置。

1.6基于XML的布局

虽然纯粹通过Java代码在activity上创建和添加部件,在技术上是可行的,我们在第4章中做的一样,更常见的方法是使用一种基于XML的布局文件。动态的小部件实例保留更多,情况复杂,小工具在编译时不为人所知(例如,在数据检索了互联网基础上将单选按钮填充柱。

考虑到这一点,现在是时候打破XML来学习如何用此种方式来布置Android activities。

正如其名称所示,一个基于XML的布局是一个关系到每个规格的小部件,和他们的容器(更多关于此内容的在第7章)编码的XML格式。具体来说,Android 认为基于XML的布局是资源,因此布局的文件存储在res /在你的Android项目布局目录中。

每个XML文件包含一个指定的部件和容器布局元素树,一种意见认为构成层次。对XML元素的属性,描述一个部件应如何看或者一个容器应如何运转。例如,如果一个按钮元素。

有一个Android的属性值:文字样式=“bold”,这意味着该文本出现在按钮的表面应该是呈现一个粗体字体样式.

Android的SDK中附带一个使用的布局的工具(aapt)。这个工具应自动调用你的Android工具链(例如,Eclipse中,Ant’s build.xml)。作为一个开发人员,尤其重要的是,在您的项目中aapt生成R.java源文件,让您能在那些布局中直接从Java代码中获取布局和部件。

XML作为一个GUI定义格式是越来越流行普遍。微软的XAML,Adobe的Flex,和Mozilla的XUL都采取Android类似的方法:把布局细节放在一个XML文件和把编程智慧资料放在源文件(例如,XUL中的JavaScript)。许多不太知名的图形用户界面框架,如ZK,还使用视图定义的XML。而“随大流”并不一定是最好的政策,但他们有优势帮助从任何其他XML为中心的观点描述语言轻松进入Android。

1 Application Fundamentals

Android applications are written in the Java programming language. The compiled Java code — along with any data and resource files required by the application — is bundled by the aapt tool into an Android package, an archive file marked by an .apk suffix. This file is the vehicle for distributing the application and installing it on mobile devices; it's the file users download to their devices. All the code in a single .apk file is considered to be one application.

In many ways, each Android application lives in its own world:

1. By default, every application runs in its own Linux process. Android starts the process when any of the application's code needs to be executed, and shuts down the process when it's no longer needed and system resources are required by other applications.

2. Each process has its own virtual machine (VM), so application code runs in isolation from the code of all other applications.

3. By default, each application is assigned a unique Linux user ID. Permissions are set so that the application's files are visible only to that user and only to the application itself — although there are ways to export them to other applications as well.

It's possible to arrange for two applications to share the same user ID, in which case they will be able to see each other's files. To conserve system resources, applications with the same ID can also arrange to run in the same Linux process, sharing the same VM.

1.1 Application Components

A central feature of Android is that one application can make use of elements of other applications (provided those applications permit it). For example, if your application needs to display a scrolling list of images and another application has developed a suitable scroller and made it available to others, you can call upon that scroller to do the work, rather than develop your own. Your application doesn't incorporate the code of the other application or link to it. Rather, it simply starts up that piece of the other application when the need arises.

For this to work, the system must be able to start an application process when any part of it is needed, and instantiate the Java objects for that part. Therefore, unlike applications on most other systems, Android applications don't have a single entry point for everything in the application (no main() function, for example). Rather, they have essential components that the system can instantiate and run as needed. There are four

types of components:

(1)Activities

An activity presents a visual user interface for one focused endeavor the user can undertake. For example, an activity might present a list of menu items users can choose from or it might display photographs along with their captions. A text messaging application might have one activity that shows a list of contacts to send messages to, a second activity to write the message to the chosen contact, and other activities to review old messages or change settings. Though they work together to form a cohesive user interface, each activity is independent of the others. Each one is implemented as a subclass of the Activity base class.

An application might consist of just one activity or, like the text messaging application just mentioned, it may contain several. What the activities are, and how many there are depends, of course, on the application and its design. Typically, one of the activities is marked as the first one that should be presented to the user when the application is launched. Moving from one activity to another is accomplished by having the current activity start the next one.

Each activity is given a default window to draw in. Typically, the window fills the screen, but it might be smaller than the screen and float on top of other windows. An activity can also make use of additional windows — for example, a pop-up dialog that calls for a user response in the midst of the activity, or a window that presents users with vital information when they select a particular item on-screen.

The visual content of the window is provided by a hierarchy of views — objects derived from the base View class. Each view controls a particular rectangular space within the window. Parent views contain and organize the layout of their children. Leaf views (those at the bottom of the hierarchy) draw in the rectangles they control and respond to user actions directed at that space. Thus, views are where the activity's interaction with the user takes place.

For example, a view might display a small image and initiate an action when the user taps that image. Android has a number of ready-made views that you can use —including buttons, text fields, scroll bars, menu items, check boxes, and more.

A view hierarchy is placed within an activity's window by the

Activity.setContentView() method. The content view is the View object at the root of the hierarchy. (See the separate User Interface document for more information on views and the hierarchy.)

(2)Services

A service doesn't have a visual user interface, but rather runs in the background for an indefinite period of time. For example, a service might play background music as the user attends to other matters, or it might fetch data over the network or calculate something and provide the result to activities that need it. Each service extends the Service base class.

A prime example is a media player playing songs from a play list. The player application would probably have one or more activities that allow the user to choose songs and start playing them. However, the music playback itself would not be handled by an activity because users will expect the music to keep playing even after they leave the player and begin something different. To keep the music going, the media player activity could start a service to run in the background. The system would then keep the music playback service running even after the activity that started it leaves the screen.

It's possible to connect to (bind to) an ongoing service (and start the service if it's not already running). While connected, you can communicate with the service through an interface that the service exposes. For the music service, this interface might allow users to pause, rewind, stop, and restart the playback.

Like activities and the other components, services run in the main thread of the application process. So that they won't block other components or the user interface, they often spawn another thread for time-consuming tasks (like music playback). See Processes and Threads, later.

(3)Broadcast receivers

A broadcast receiver is a component that does nothing but receive and react to broadcast announcements. Many broadcasts originate in system code — for example, announcements that the timezone has changed, that the battery is low, that a picture has been taken, or that the user changed a language preference. Applications can also initiate broadcasts — for example, to let other applications know that some data has been downloaded to the device and is available for them to use.

An application can have any number of broadcast receivers to respond to any announcements it considers important. All receivers extend the BroadcastReceiver base class.

Broadcast receivers do not display a user interface. However, they may start an activity in response to the information they receive, or they may use the NotificationManager to alert the user. Notifications can get the user's attention in various ways — flashing the backlight, vibrating the device, playing a sound, and so on. They typically place a persistent icon in the status bar, which users can open to get the

message.

(4)Content providers

A content provider makes a specific set of the application's data available to other applications. The data can be stored in the file system, in an SQLite database, or in any other manner that makes sense. The content provider extends the ContentProvider base class to implement a standard set of methods that enable other applications to retrieve and store data of the type it controls. However, applications do not call these methods directly. Rather they use a ContentResolver object and call its methods instead. A ContentResolver can talk to any content provider; it cooperates with the provider to manage any interprocess communication that's involved.

See the separate Content Providers document for more information on using content providers.

Whenever there's a request that should be handled by a particular component, Android makes sure that the application process of the component is running, starting it if necessary, and that an appropriate instance of the component is available, creating the instance if necessary.

1.2 Activating components: intents

Content providers are activated when they're targeted by a request from a ContentResolver. The other three components — activities, services, and broadcast receivers — are activated by asynchronous messages called intents. An intent is an Intent object that holds the content of the message. For activities and services, it names the action being requested and specifies the URI of the data to act on, among other things. For example, it might convey a request for an activity to present an image to the user or let the user edit some text. For broadcast receivers, the

Intent object names the action being announced. For example, it might announce to interested parties that the camera button has been pressed.

There are separate methods for activating each type of component:

1. An activity is launched (or given something new to do) by passing an Intent object to

Context.startActivity() or Activity.startActivityForResult(). The responding activity can look at the initial intent that caused it to be launched by calling its getIntent() method. Android calls the activity's onNewIntent() method to pass it any subsequent intents. One activity often starts the next one. If it expects a result back from the activity it's starting, it calls startActivityForResult() instead of startActivity(). For example, if

it starts an activity that lets the user pick a photo, it might expect to be returned the chosen photo. The result is returned in an Intent object that's passed to the calling activity's onActivityResult() method.

2. A service is started (or new instructions are given to an ongoing service) by passing an Intent object to Context.startService(). Android calls the service's onStart() method and passes it the Intent object. Similarly, an intent can be passed to Context.bindService() to establish an ongoing connection between the calling component and a target service. The service receives the Intent object in an onBind() call. (If the service is not already running, bindService() can optionally start it.) For example, an activity might establish a connection with the music playback service mentioned earlier so that it can provide the user with the means (a user interface) for controlling the playback. The activity would call bindService() to set up that connection, and then call methods defined by the service to affect the playback.

A later section, Remote procedure calls, has more details about binding to a service.

3. An application can initiate a broadcast by passing an Intent object to methods like Context.sendBroadcast(), Context.sendOrderedBroadcast(), and

Context.sendStickyBroadcast() in any of their variations.

Android delivers the intent to all interested broadcast receivers by calling their onReceive() methods. For more on intent messages, see the separate article, Intents and Intent Filters.

1.3 Shutting down components

A content provider is active only while it's responding to a request from a ContentResolver. And a broadcast receiver is active only while it's responding to a broadcast message. So there's no need to explicitly shut down these components. Activities, on the other hand, provide the user interface. They're in a long-running conversation with the user and may remain active, even when idle, as long as the conversation continues. Similarly, services may also remain running for a long time. So Android has methods to shut down activities and services in an orderly way:

1. An activity can be shut down by calling its finish() method. One activity can shut down another activity (one it started with startActivityForResult()) by calling finishActivity().

2. A service can be stopped by calling its stopSelf() method, or by calling

Context.stopService().

Components might also be shut down by the system when they are no longer being

used or when Android must reclaim memory for more active components. A later section, Component Lifecycles, discusses this possibility and its ramifications in more detail.

1.4 The manifest file

Before Android can start an application component, it must learn that the component exists. Therefore, applications declare their components in a manifest file that's bundled into the Android package, the .apk file that also holds the application's code, files, and resources.

The manifest is a structured XML file and is always named AndroidManifest.xml for all applications. It does a number of things in addition to declaring the application's components, such as naming any libraries the application needs to be linked against (besides the default Android library) and identifying any permissions the application expects to be granted.

But the principal task of the manifest is to inform Android about the application's components. For example, an activity might be declared as follows:

The name attribute of the element names the Activity subclass that implements the activity. The icon and label attributes point to resource files containing an icon and label that can be displayed to users to represent the activity.

The other components are declared in a similar way — elements for services, elements for broadcast receivers, and elements for content providers. Activities, services, and content providers that are not declared in the manifest are not visible to the system and are consequently never run. However, broadcast receivers can either be declared in the manifest, or they can be created dynamically in code (as BroadcastReceiver objects) and registered with the system by calling Context.registerReceiver().

For more on how to structure a manifest file for your application, see The Android

Manifest.xml File.

1.5 Intent filters

An Intent object can explicitly name a target component. If it does, Android finds that component (based on the declarations in the manifest file) and activates it. But if a target is not explicitly named, Android must locate the best component to respond to the intent. It does so by comparing the Intent object to the intent filters of potential targets. A component's intent filters inform Android of the kinds of intents the component is able to handle. Like other essential information about the component, they're declared in the manifest file. Here's an extension of the previous example that adds two intent filters to the activity:

The first filter in the example — the combination of the action

"android.intent.action.MAIN" and the category

"https://www.doczj.com/doc/0218726517.html,UNCHER" — is a common one. It marks the activity as one that should be represented in the application launcher, the screen listing applications users can launch on the device. In other words, the activity is the entry point for the application, the initial one users would see when they choose the application in the launcher.

The second filter declares an action that the activity can perform on a particular type

of data.

A component can have any number of intent filters, each one declaring a different set of capabilities. If it doesn't have any filters, it can be activated only by intents that explicitly name the component as the target.

For a broadcast receiver that's created and registered in code, the intent filter is instantiated directly as an IntentFilter object. All other filters are set up in the manifest. For more on intent filters, see a separate document, Intents and Intent Filters.

1.6 XML-Based Layout

While it is technically possible to create and attach widgets to our activity purely through Java code, the way we did in Chapter 4, the more common approach is to use an XML-based layout file. Dynamic instantiation of widgets is reserved for more complicated scenarios, where the widgets are not known at compile-time (e g., populating a column of radio buttons based on data retrieved off the Internet).

With that in mind, it’s time to break out the XML and learn how to lay out Android activities that way.

As the name suggests, an XML-based layout is a specification of widgets’ relationships to each other—and to their containers (more on this in Chapter 7)—encoded in XML format. Specifically, Android considers XML-based layouts to be resources, and as such layout files are stored in the res/layout directory inside your Android project.

Each XML file contains a tree of elements specifying a layout of widgets and their containers that make up one view hierarchy. The attributes of the XML elements are properties, describing how a widget should look or how a container should behave. For example, if a Button element has an attribute value of android:textStyle = "bold", that means that the text appearing on the face of the button should be rendered in a boldface font style.

Android’s SDK ships with a tool (aapt) which uses the layouts. This tool should be automatically invoked by your Android tool chain (e.g., Eclipse, Ant’s build.xml). Of particular importance to you as a developer is that aapt generates the R.java source file within your project, allowing you to access layouts and widgets within those layouts directly from your Java code.

XML as a GUI definition format is becoming more commonplace. Microsoft’s XAML2, Adobe’s Flex3, and Mozilla’s XUL4 all take a similar approach to t hat of Android: put layout details in an XML file and put programming smarts in source files

(e.g., JavaScript for XUL). Many less-well-known GUI frameworks, such as ZK5, also use XML for view definition. While “following the herd” is not necessarily the b est policy, it does have the advantage of helping to ease the transition into Android from any other XML-centered view description language.

外文翻译-基于Android智能家居系统

通信工程学院 毕业设计外文翻译 毕业设计题目基于ANDRIO的智能家居 系统的设计与实现 外文题目UBIQUITOUS SMART HOME SYSTEM USING ANDROID APPLICATION 专业:通信工程 学号: 学生姓名: 指导教师姓名: 指导教师职称:副教授 日期:2015 年 1 月10 日

International Journal of Computer Networks & Communications (IJCNC) V ol.6, No.1, January 2014 基于Android应用的无处不在的智能家居系统 Shiu Kumar Department of Information Electronics Engineering, Mokpo National University, 534-729, Mokpo, South Korea 摘要 本文提出了一种灵活独立的,低成本的智能家居系统,它是基于Android应用与微web服务器通信,不仅仅提供交换功能。Arduino以太网的使用是为了避免使用个人电脑从而保证整个系统成本最低,语音激活时用来实现切换功能的。光开关,电源插头,温度传感器,湿度传感器,电流传感器,入侵检测传感器,烟雾/气体传感器和警报器等这些设备集成在系统中,表明了所提出的智能家居系统的有效性和可行性。经过检测,智能家居应用程序可以成功地进行智能家居操作,例如开关功能,自动环境监测,和入侵监测,在监测到有不法入侵后,系统会自动发送一个邮件,并响警笛。 关键字: Android智能手机,智能家居,物联网(loTs),远程控制 1.引言 随着移动设备受欢迎程度的不断增长和人们日常生活中对无处不在的先进的移动应用的功能需求不断增加,利用Web服务是提供远程访问服务的最开放和可互操作的方式,并且使应用程序能够彼此通信。一个有吸引力的市场产品自动化和网络化是忙碌的家庭和有生理缺陷的个人的代表。 loTs可以被描述为连接智能手机,网络电视,传感器等到互联网,实现人们之间沟通的新形势。过去几年中loTs的发展,创造了一个新层面的世界。这使得人们可以在任何时间,任何地点,联通任何期望的东西。物联网技术可用于为智能家居创建新的概念和广阔的空间,以提供智能,舒适的发展空间和完善生活质量。 智能家居是一个非常有前途的领域,其中有各种好处,如增加提供舒适性,更高安全性,更合理地使用能源和其他资源。这项研究的应用领域非常重要,未来它为帮助和支持有特殊需求老的人和残疾人士提供了强有力的手段。设计一个智能家居系统时需要考虑许多因素,该系统应该是经济实惠的,是可伸缩的,使得新的设备可以容易地集成到系统中,此外,它应该是用户友好的。 随着智能手机用户的急剧增加,智能手机已经逐渐变成了具备所有功能的便携式设备,为人们提供了日常使用。本文介绍了一种低成本的控制和监视家居环境控制的无线智能家居系统。利用Android设备,可以通过一个嵌入式微Web服务器与实际的IP连接,访问和控制电器和远程的其它设备,这可以利用任何支持Android的设备。Arduino Ethernet 用于微Web服务器从

Android系统架构详解

Android系统架构详解 Android系统架构由5部分组成, 分别是:Linux Kernel、Android Runtime、Libraries、Application Framework、Applications。 1、Linux Kernel Android relies on Linux version 2.6 for core system services such as security, memory management, process management, network stack, and driver model. The kernel also acts as an abstraction layer between the hardware and the rest of the software stack. Android基于Linux 2.6提供核心系统服务,例如:安全、内存管理、进程管理、网络堆栈、驱动模型。Linux Kernel也作为硬件和软件之间的抽象层,它隐藏具体硬件细节而为上层提供统一的服务。如果你学过计算机网络知道OSI/RM,就会知道分层的好处就是使用下层提供的服务而为上层提供统一的服务,屏蔽本层及以下层的差异,当本层及以下层发生了变化不会影响到上层。也就是说各层各尽其职,各层提供固定的SAP(Service Access Point),专业点可以说是高内聚、低耦合。如果你只是做应用开发,就不需要深入了解Linux Kernel层。 2、Android Runtime Android includes a set of core libraries that provides most of the functionality available in the core libraries of the Java programming language. Android包括一个核心库的集合,她们提供了Java编程语言的核心库中的绝大多数功能。 Every Android application runs in its own process, with its own instance of the Dalvik virtual

(精品文献)Android外文翻译

本科毕业设计(论文)外文参考文献译文及原文 学院信息工程学院 专业测控技术与仪器 (光机电一体化方向) 年级班别 2011级(1)班 学号 学生姓名 指导教师

目录 1应用程序基础 (1) 1.1应用程序组件 (1) 1.2激活组件:intent (3) 1.3 关闭组件 (4) 1.4manifest文件 (5) 1.5Intent过滤器 (6) 1.6基于XML的布局 (7) 1Application Fundamentals (8) 1.1 Application Components (8) 1.2Activating components:intent (11) 1.3 Shutting down components (12) 1.4 The manifest file (13) 1.5Intent filters (14) 1.6XML-Based Layout (15)

1 应用程序基础 Android应用程序使用Java编程语言开发。aapt工具把编译后的Java代码连同应用程序所需的其他数据和资源文件一起打包到一个Android包文件中,这个文件使用.apk作为扩展名。此文件是分发并安装应用程序到移动设备的载体;是用户下载到他们的设备的文件。单一.apk文件中的所有代码被认为是一个应用程序。 从多个角度来看,每个Android应用程序都存在于它自己的世界之中: 1 默认情况下,每个应用程序均运行于它自己的Linux进程中。当应用程序中的任何代码需要被执行时,Android启动此进程,而当不再需要此进程并且其它应用程序又请求系统资源时,则就关闭了这个进程。 2 每个进程都有其独有的虚拟机(VM),所以应用程序代码与所有其它应用程序代码是隔离运行的。 3 默认情况下,每个应用程序均被赋予一个唯一的Linux用户ID,并加以权限设置,使得应用程序的文件仅对此用户及此应用程序可见——尽管也有其它的方法使得这些文件同样能为其他应用程序所访问。 1.1 应用程序组件 Android的一个核心的特性就是一个应用程序可以使用其它应用程序的元素(如果那个应用程序允许的话)。例如,如果你的应用程序需要显示一个图片卷动列表,而另一个应用程序已经开发了一个合用的而又允许别的应用程序使用的话,你可以直接调用那个卷动列表来完成工作,而不用自己再开发一个。你的应用程序并没有吸纳或链接其它应用程序的代码。它只是在有需求的时候启动了其它应用程序的那个功能部分。 为达到这个目的,系统必须能够在一个应用程序的任何一部分被需要时启动一个此应用程序的进程,并将那个部分的Java对象实例化。因此,不像其它大多数系统上的应用程序,Android应用程序并没有为应用程序提供一个单独的入口点(比如说,没有main()函数),而是为系统提供了可以实例化和运行所需的必备组件。一共有四种组件类型: (1)Activity

Android手机外文翻译---应用程序基础Android Developers

英文原文及译文 Application Fundamentals Android applications are written in the Java programming language. The compiled Java code —along with any data and resource files required by the application —is bundled by the aapt tool into an Android package, an archive file marked by an .apk suffix. This file is the vehicle for distributing the application and installing it on mobile devices; it's the file users download to their devices. All the code in a single .apk file is considered to be one application. In many ways, each Android application lives in its own world: 1. By default, every application runs in its own Linux process. Android starts the process when any of the application's code needs to be executed, and shuts down the process when it's no longer needed and system resources are required by other applications. 2. Each process has its own virtual machine (VM), so application code runs in isolation from the code of all other applications. 3. By default, each application is assigned a unique Linux user ID. Permissions are set so that the application's files are visible only to that user and only to the application itself — although there are ways to export them to other applications as well. It's possible to arrange for two applications to share the same user ID, in which case they will be able to see each other's files. To conserve system resources, applications with the same ID can also arrange to run in the same Linux process, sharing the same VM. Application Components A central feature of Android is that one application can make use of elements of other applications (provided those applications permit it). For example, if your application needs to display a scrolling list of images and another application has developed a suitable scroller and made it available to others, you can call upon that scroller to do the work, rather than develop your own. Your application doesn't incorporate the code of the other application or link to it. Rather, it simply starts up that piece of the other application when the need arises. For this to work, the system must be able to start an application process when any part of it is needed, and instantiate the Java objects for that part. Therefore, unlike applications on most other systems, Android applications don't have a single entry point for everything in the application (no main() function, for example). Rather, they have essential components that the system can instantiate and run as needed. There are four types of components: Activities

安卓系统简介及如何分区的

android操作系统的分区 对电脑系统了解的朋友都知道,简单来说,电脑分硬件和软件两大块,软件装在硬盘上,比如操作系统windows,使用者通过windows来控制机器硬件,达到使用电脑的目的。 手机也分为硬件和软件两块,软件则是装在闪存(即flash memory,一种存储器)上的,闪存有大小的区别,就像硬盘有大小一样,看手机硬件配置的时候,通常会看到如下介绍:ROM 512M,RAM 512M,ROM就是指的闪存了,相当于电脑上的硬盘,用来存放操作系统和用户数据等信息。相应的,RAM就是指的内存了。 手机出厂时都是装好系统的,这点类似于电脑世界里面的品牌电脑,通过分析手机闪存上的内容可以知道,android操作系统主要有以下几个重要的分区(包括但不限于): hboot分区----------负责启动。 radio分区----------负责驱动。 recovery分区-------负责恢复。 boot分区-----------系统内核。 system分区---------系统文件。 cache分区----------系统缓存。 userdata分区-------用户数据。 1、hboot(SPL):这里指的是手机上的启动模块,通俗的说,就是负责手机启动引导的一段程序,类似于电脑主板上的BIOS,都是负责底层操作的。和在电脑上刷新BIOS一样,刷错了,电脑就会开不了机,对手机来说也一样,这部分的内容刷错了,手机就会变砖!

2、radio:这里指的是手机上的通讯模块,又叫做基带。负责手机的无线信号,蓝牙,WIFI等设备的管理,也就是说,相当于电脑系统里面的硬件驱动部分。这样说或许也不是特别的准确,大家明白大概的意思就可以了。通常我们所说的刷radio,刷基带,就是指的刷写这一部分,以便解决通话质量、网络连接质量、蓝牙连接等等问题。 3、recovery:字面意思是恢复,手机上的一个功能分区,有点类似于笔记本电脑上的恢复分区。一般大厂出的笔记本,都会自带一个特殊分区,里面保存着系统的镜像文件,当系统出问题的时候,我们可以通过它来一键恢复系统。这里的recovery功能有些类似。其实,他更像是电脑上的小型winPE系统,可以允许我们通过启动到winPE系统上,去做一些备份、恢复的工作。当然,系统自带的recovery基本没用,所以我们通常会刷入一个第三方的recovery,以便实现更多的功能,例如:备份系统,恢复系统,刷新系统等。但官方自带的recovery 也不是一无是处,在使用OTA方式升级系统时候,会检查此分区内容,如果不是原厂自带的,OTA升级就会失败。 4、fastboot:字面意思是快速启动,在这里,其实是一个特殊的工程模式,通过fastboot界面,连接电脑后,我们可以在电脑端通过特殊的指令来操作手机,例如更新radio,就可以通过fastboot来完成。fastboot的级别又要比recovery 来的要高一些,可以完成更底层的一些操作。后面我们会结合实际,来讲解一些fastboot的用法,更详细的资料,大家可以通过网络来学习,这里不再赘述。 5、ADB:android debug bridge,字面意思就是安卓调试桥接,简单点说,它是android系统提供的一套工具,通过它,我们可以在电脑上建立一个连接到手机的通道,然后可以在电脑上向手机发送一些指令,完成一些我们需要做的工作。ADB的用法我们后面也会作相应的介绍。 6、ROM:read only memory,只读存储器。上面我们讲过的,android系统都是安装在闪存里面的,这个闪存,就是一种只读存储器,断电情况下里面的内容不会消失。刷机,就是刷的ROM。有点类似电脑里的硬盘,ROM里面有很多分区,hboot、boot、system等等,前文介绍过的,还记得吗?说到这里,想到一个好笑的事情,某人问老婆,知道什么是ROM吗?答曰:room?不就是房子吗?晕倒,我说的是R O M ,不是R O O M!!奥,那就是小房子了!狂晕!!

基于安卓的大学生记账管理系统的设计与实现-外文翻译译文和原文

基于安卓的大学生记账管理系统的设计与实现-外文翻译译 文和原文 毕业设计外文文献翻译 院系: 计算机与信息工程学院年级专业: 12软件工程(金融服务)2 姓名: 学号: An Analysis of Personal Financial Lit Among 附件: College Students Among College Students 指导老师评语: 指导教师签名: 年月日 大学生个人理财知识分析 大学生个人理财知识分析 这项研究调查了924名大学生审视自己的个人财务知识;调查了学生的财务知识与学生的特性之间的关系,和理财知识对学生的意见和决定的影响。结果表明,参与者回答问题的正确性为53,。所调查的人包括非经营性专业、妇女、在下层阶级行列的学生、30岁以下并且很少有工作经验的人、知识水平较低者。懂得较少财务知识的学生往往有错误的观点和作出不正确的决定。结论是:大学生不太了解个人理财。低的财务知识水平会限制他们做出明智决策的能力。 I. 介绍 管理个人财务的能力在当今世界已经变得越来越重要。人们必须计划为他们的退休和子女的教育长期投资。他们还必须决定短期储蓄和借贷一个假期,向下支付

房子,汽车贷款和其他大件物品。此外,他们还必须管理自己的医疗保险和人寿保险的需求。 不幸的是,研究表明,美国人有个人认识不足财政(EBRI,1995年,毕马威会计师事务所,1995年; PSRA,1996年,1997年,奥本海默基金/女孩公司,1997年;先锋集团/货币杂志,1997年)。他们未能作出正确决策因为他们还没有收到良好的个人理财教育(HSR,1993年,希拉,1993;奥尼尔,1993年)。 这项研究有三个目的。首先,它提供大学生个人理财素养的证据。其次,它会检查为什么一些大学生相对比别人有更多的理财知识。该分析可以帮助我们识别出大学生所拥有决定能力水平的因素。第三个目的是检查学生的知识如何影响他/她的意见和个人财务问题上的决定。 本文的结构安排如下。第二部分回顾了以前对金融知识的研究。第三部分是讨论方法。第四部分是提出的结果。第五部分总结全文。 II. 文献回顾 大部分以前的研究都是由在金融服务行业的从业人员进行。他们专注于资金管理和投资有关的问题。这个重点与会计师财务策划师的调查结果一致,说明这些问题是个人理财规划的重要领域(NEFE,1993-1996)。这些研究结果表明,参与的调查者回答调查问题的正确率普遍只有不到60,。 此前高中生的研究均发现,他们在个人财务的基本知识上未受到良好的教育,并且知识贫乏(巴肯,1967; CFAJAMEX,1991; HSR,1993; Langrehr,1979; NAEP,1979)。在对来自63所学校的1509高中学生的调查研究中,曼德尔(1997)报告了一个平均正确的比分,57,在收入、资金管理、储蓄、投资和消费等领域。他的结论是:学生们离开学校时没有做出关键决策影响他们生活的能力。 难道成年人对个人理财和投资有一个很好的控制,几个结果研究表明,他们并 1

Android系统架构简介

Android系统架构简介 Android系统架构简介 目前Android的Linuxkernel控制包括安全、存储器管理、进程管理、网络堆叠、驱动程序模型等。下载Android源码之前,先要 安装其构建工具Repo来初始化源码。Repo是Android用来辅助Git 工作的一个工具。 应用程序 Android系统是基于Linux内核开发,使用Java作编程语言, 使界面到功能,都有层出不穷的变化,其中Activity等同于J2ME 的MIDlet,一个Activity类别负责创建视窗,一个活动中的 Activity就是在foreground(前景)模式,背景执行的程序叫做Service。两者之间透过由ServiceConnection和AIDL连结,达到 复数程序同时执行的效果。如果执行中的Activity全部画面被其他Activity取代时,该Activity便被停止,甚至被系统清除。 View等同于J2ME的Displayable,程序人员可以透过View类别与“XMLlayout”档将UI放置在视窗上,并可以利用View打造出所 谓的Widgets,其实Widget只是View的一种,所以可以使用xml 来设计layout。至于ViewGroup是各种layout的基础抽象类别,ViewGroup之内还可以有ViewGroup。View的构造函数不需要在Activity中调用,但是Displayable的是必须的,在Activity中,要通过findViewById()来从XML中获取View,Android的View类 的显示很大程度上是从XML中读取的。View与事件息息相关,两者 之间透过Listener结合在一起,每一个View都可以注册eventlistener,例如:当View要处理用户触碰的事件时,就要向Android框架注册View.OnClickListener。另外还有Image等同于 J2ME的BitMap。 中介软件

Android系统外文翻译

附录1:外文原文 What Is Android? It can be said that, for a while, traditional desktop application developers have beenspoiled. This is not to say that traditional desktop application development is easier thanother forms of development. However, as traditional desktop application developers, wehave had the ability to create almost any kind of application we can imagine. I amincluding myself in this grouping because I got my start in desktop programming. One aspect that has made desktop programming more accessible is that we havehad the ability to interact with the desktop operating system, and thus interact with anyunderlying hardware, pretty freely (or at least with minimal exceptions). This kind offreedom to program independently, however, has never really been available to thesmall group of programmers who dared to venture into the murky waters of cell phonedevelopment. For a long time, cell phone developers comprised a small sect of a slightly larger group of developers known as embedded device developers. Seen as a less “glamorous” sibling to desktop—and later web—development, embedded device development typically got the proverbial short end of the stick as far as hardware and operating system features, because embedded device manufacturers were notoriously stingy on feature support. Embedded device manufacturers typically needed to guard their hardware secrets closely, so they gave embedded device developers few libraries to call when trying to interact with a specific device. Embedded devices differ from desktops in that an embedded device is typically a “computer on a chip.” For example, consider your standard television remote control; it is not really seen as an overwhelming achievement of technological complexity. When any button is pressed, a chip interprets the signal in a way that has been programmed into the device. This allows the device to know what to expect from the input device (key pad), and how to respond to those commands (for example, turn on the television). This is a simple form of embedded device programming. However, believe it or not, simple devices such as these are definitely related to the roots of early cell phone devices and development. Most embedded devices ran (and in some cases still run) proprietary operating systems. The reason for choosing to create a proprietary operating system rather than use any consumer system was really a product of necessity. Simple devices did not need very robust and optimized operating systems. As a product of device evolution, many of the more complex embedded devices, such as early PDAs, household security systems, and GPSs, moved to somewhat standardized operating system platforms about five years ago. Small-footprint

Android系统原理及开发要点详解.

内容简介 本书全面介绍开放的移动电话平台Android系统,包括Android系统中的Linux 驱动、本地框架、Java框架和Java应用4个层次。本书内容以知识性内容为纲,重点关注开发要点,各个部分内容注重相互照应,按照清晰的思路向读者介绍整个Android系统的原理和开发方法。 本书按照Android系统的框架和各个子系统的主线,重点介绍开发Android应用程序和构建硬件抽象层。其内容涵盖了Android应用程序开发和Android系统移植构建手机系统两大方面。 本书既适合从事Android各个层次开发的工程师阅读,也适合通用嵌入式Linux 系统的学习者使用。 本书购买地址:当当网卓越网中国互动出版网 作者简介 梁泉是移动系统开发资深工程师,在Android领域具有完备的知识和前沿的技术,长期从事一线开发工作。 韩超是中国大陆地区较早参与Android系统开发的人员之一,也是中国大陆的Androidin(机锋网开发社区的核心成员和重要组织者之一;也曾经引领大陆各种相关技术人员进入Android领域,并组织参与国内外的相关枝术交流。 前言 Android 是Google历经数年和投资数亿美元开发出来的智能手机系统,Google 也发起了围绕Android的组织——开放手机联盟,其英文全称为“Open Handset Alliance”。

随着各大移动终端生产商大力开发和生产基于Android的移动智能设 备,Android迅速得到业界和社会的认可,并成为整个产业的热点,基于Android平台的各类人才逐渐成为各大企业竞相争夺的焦点。 Android系统是一个开放的系统,任何公司、个人开发者、爱好者都可以参与其中。对于技术工作者,Android不仅是一个智能手机的系统,也可以作为学习嵌入式Linux系统的较完整的软件平台。 Android是一个较新的系统和技术,因此介绍Android的资料和书籍还比较少,尤其简体中文的书籍,相对更少。本书《Android系统原理及开发要点详解》是一本综合介绍Android系统的书,集合了Androidin社区多位专家作者的经验,精心编写而成。 Android 作为一个庞大的系统,包括了Linux操作系统、各种本地程序、虚拟机和运行环境、Java框架和Java应用程序多方面的内容。这对于初学者是一个非常大的挑战,因此对于学习、研究进而开发Android系统来说,掌握系统的脉络和使用恰当的学习方法是非常重要的,这也是本书的组织主旨。 本书特点为了适应Android系统的情况,本书在内容的编排和组织上具有以下一些重要特点。 保持完整性和层次性本书紧紧把握Android系统的4个层次,分章节介绍,并且有重点地介绍了Android整个系统的代码结构、编译系统、相关工具、各部分组织等全局性内容。这将让读者即使只花费较短的时间,也可以获得对Android 系统大致的感性理解。 提供清晰的框架Android是一个有数百兆大小的较大系统,各部分之间是有机联系的,这就要求Android的学习和开发者需要具有一些软件架构方面的知识。本书为Android整体和重点模块绘制了大量的框图,这样非常有利于帮助读者直观地理解系统。本书在讲述每一个部分时,均列出相关代码的路径,帮助读者对应着进行快速、高效地学习。

Android应用架构外文翻译

Android Application Architecture author:Lars V ogel 1、AndroidManifest.xml The components and settings of an Android application are described in the file AndroidManifest.xml. For example all Activities and Services of the application must be declared in this file. It must also contain the required permissions for the application. For example if the application requires network access it must be specified here. The package attribute defines the base package for the Java objects referred to in this file. If a Java object lies within a different package, it must be declared with the

linux内核启动 Android系统启动过程详解

linux内核启动+Android系统启动过程详解 第一部分:汇编部分 Linux启动之 linux-rk3288-tchip/kernel/arch/arm/boot/compressed/ head.S分析这段代码是linux boot后执行的第一个程序,完成的主要工作是解压内核,然后跳转到相关执行地址。这部分代码在做驱动开发时不需要改动,但分析其执行流程对是理解android的第一步 开头有一段宏定义这是gnu arm汇编的宏定义。关于GUN 的汇编和其他编译器,在指令语法上有很大差别,具体可查询相关GUN汇编语法了解 另外此段代码必须不能包括重定位部分。因为这时一开始必须要立即运行的。所谓重定位,比如当编译时某个文件用到外部符号是用动态链接库的方式,那么该文件生成的目标文件将包含重定位信息,在加载时需要重定位该符号,否则执行时将因找不到地址而出错 #ifdef DEBUG//开始是调试用,主要是一些打印输出函数,不用关心 #if defined(CONFIG_DEBUG_ICEDCC)

……具体代码略 #endif 宏定义结束之后定义了一个段, .section ".start", #alloc, #execinstr 这个段的段名是 .start,#alloc表示Section contains allocated data, #execinstr表示Section contains executable instructions. 生成最终映像时,这段代码会放在最开头 .align start: .type start,#function /*.type指定start这个符号是函数类型*/ .rept 8 mov r0, r0 //将此命令重复8次,相当于nop,这里是为中断向量保存空间 .endr b 1f .word 0x016f2818 @ Magic numbers to help the loader

安卓应用开发基础论文中英文对照资料外文翻译文献

安卓应用开发基础论文中英文对照 资料外文翻译文献 中英文对照资料外文翻译文献安卓应用开发基础在Java编程语言编写的Android应用程序的Android的SDK工具编译代码以及与任何数据和到一个Android的包,一个归档文件档案资源的.apk后缀,所有的在一个单一的代码.apk文件被认为是一个应用程序,是Android的文件,供电设备来安装应用程序。一旦安装在设备上,每个Android应用程序的生命在它自己的安全沙箱:而Android操作系统是一个多用户Linux系统中,每个应用程序是一个不同的用户。默认情况下,每个应用程序的系统分配一个唯一的Linux用户ID,系统设置所有的应用程序中的文件权限,以便只有用户ID分配给该应用程序可以访问它们。每个进程都有它自己的虚拟

机,因此应用程序的代码在从其他应用程序隔离运行。默认情况下,每个应用程序运行在它自己的Linux进程。Android的启动过程时,应用程序的任何组件需要被执行,然后关闭该进程时,它不再需要或恢复时,系统必须为其他应用程序的内存。这样一来,Android系统实现了最小特权原则,也就是说,每个应用程序,默认情况下,只能访问的组件,它需要做的工作,没有更多,这将创建一个非常安全的环境,使应用程序无法访问的,这就是它没有给予许可制度的部分。但是,有一个应用程序的方法与其他应用程序和应用程序访问系统服务的数据:这有可能为两个应用程序安排共享相同的Linux用户ID,在这种情况下,它们能够相互访问的文件。为了节约使用相同的用户ID系统资源,应用程序还1 可以安排运行在相同的Linux进程和共享同一个VM。应用程序可以请求访问权限,如用户的联

android系统详细介绍

android Android一词的本义指“机器人”,同时也是Google于2007年11月5日宣布的基于Linu x平台的开源手机操作系统的名称,该平台由操作系统、中间件、用户界面和应用软件组成,号称是首个为移动终端打造的真正开放和完整的移动软件。目前最好的是Android2.0的摩托罗拉Droid 目录[显示] [编辑本段] 简介 Android是基于Linux内核的软件平台和操作系统,早期由Google开发,后由开放手机联盟(Open Handset Alliance)开发。它采用了软件堆层(software st ack,又名为软件叠层)的架构,主要分为三部分。底层以Linux内核工作为基础,只提供基本功能;其他的应用软件则由各公司自行开发,以Java作为编写程序的一部分。另外,为了推广此技术,Google和其它几十个手机公司建立了开放手机联盟。Android在未公开之前常被传闻为Google电话或gPhone。大多传闻认为Goog le开发的是自己的手机电话产品,而不是一套软件平台。到了2010年1月,Googl e开始发表自家品牌手机电话的NexusOne。目前最新版本为Android2.1。 对手机行业的影响 已经与HTC、NTT DoCoMo、KDDI、Motorola等世界移动领域34家公司于免费提供达成一致。今后对于移动通讯的影响势必会进一步体现出来。但是如此广泛公司的同盟是否能够有效运作以及持久,让我们拭目以待。 Android手机 2008年9月22日,美国运营商T-MobileUSA在纽约正式发布第一款Goog le手机——T-Mobile G1。该款手机为台湾宏达电代工制造,是世界上第一部使用Android操作系统的手机,支持WCDMA/HSPA网络,理论下载速率7.2Mbps,并支持Wi-Fi。 (左图为Androidlogo) [编辑本段]

Android系统外文翻译3

Android起航 译 使用XML进行布局 虽然纯粹通过Java代码在activity上创建和添加部件,在技术上是可行的,我们在第4章中做的一样,更常见的方法是使用一种基于XML的布局文件。动态的小部件实例保留更多,情况复杂,小工具在编译时不为人所知(例如,在数据检索了互联网基础上将单选按钮填充柱。 考虑到这一点,现在是时候打破XML来学习如何用此种方式来布置Android activities。 什么是基于XML的布局? 正如其名称所示,一个基于XML的布局是一个关系到每个规格的小部件,和他们的容器(更多关于此内容的在第7章)编码的XML格式。具体来说,Android 认为基于XML的布局是资源,因此布局文件存储在res /在你的Android项目布局目录中。 每个XML文件包含一个指定的部件和容器布局元素树,一种意见认为构成层次。对XML元素的属性,描述一个部件应如何看或者一个容器应如何运转。例如,如果一个按钮元素。 有一个Android的属性值:文字样式=“bold”,这意味着该文本出现在按钮的表面应该是呈现一个粗体字体样式. Android的SDK中附带一个使用的布局的工具(aapt)。这个工具应自动调用你的Android工具链(例如,Eclipse中,Ant’s build.xml)。作为一个开发人员,尤其重要的是,在您的项目中aapt生成R.java源文件,让您能在那些布局中直接从Java代码中获取布局和部件。 为什么使用基于XML的布局? 使用XML布局文件做的大部分都可以通过Java代码。例如,你可以使用setTypeface()命令一个按钮使用粗体文本,而不是在一个XML布局中使用属性。由于XML布局是为你跟踪的另一个文件,所以我们需要好的理由来使用这样的文

相关主题
相关文档 最新文档