有关android技术英文文献翻译(共16页).doc
《有关android技术英文文献翻译(共16页).doc》由会员分享,可在线阅读,更多相关《有关android技术英文文献翻译(共16页).doc(17页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
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
2、 is the vehicle for distributing the application and installing it on mobile devices; its the file users download to their devices. All the code in a single .apk file is considered to be one application. Android应用基础:Android应用程序是通过java语言开发的,通过绑定一些应用所需要的东西,例如:编译的Java代码,加上数据和一些资源文件,使用一个apt的工具将所有的东西封装成一
3、个android包,这个文件的文件后缀是.apk。这个文件是分发并安装应用程序到移动设备的载体,是用户获得该应用程序所需要的下载的文件。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 o
4、f 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 doesnt incorporate the code of the other application or link to it. Rather, it simply starts up that piec
5、e 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 dont have a single entr
6、y 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 An activity presents a visual user interface for one focused endeavor the user can und
7、ertake. 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 c
8、hosen 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
9、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
10、 is launched. Moving from one activity to another is accomplished by having the current activity start the next one. Android有四大应用程序组件Android的一个很重要的中心特征就是一个应用程序能充分利用其他的应用程序的一些组件(前提是被允许的) 例如:如果的当前开发的应用需要一个滚动的列表去展示相片并且当时其他的程序已经开发了一个合适的滚动列表并且对其他人可用,你可以调用这个滚动的列表来完成你的工作而不是开发你自己的。你的应用不需要包含那个应用的代码或来链接它。相反,它
11、只是简单的在你需要它是启动这部分的应用为了实现这部分的功能,当前系统必须能启动其他应用程序进程的功能当那些部分它需要时,并且为这部分的java对象初始化这个java对象。因此,不想在其他系统中的应用程序,android应用程序不需要一个单一的入口点(例如:没有main()而是,提供了实例化和运行所需的必备组件。Android有四大应用程序组件1:activity一个Activity基类是为展示可视化用户接口。例如:一个Activity可以显示一个供用户选择的菜单列表,或者可以展示一些图片以及对应的说明。一个短信的应用有一个活动显示发送消息的一系列的联系人,第二个活动去编写信息文本去选择联系人,
12、第三个活动去查看以前的信息或修改一些设置。虽然它们组成了一个内聚的用户界面,每一个活动都和其他的的相互独立,每一个都继承Activity,是Activity的子类。一个应用程序可以只有一个Activity,但是也可以有多个,比如刚刚提到的文本应用。每个程序的作用,有多少个程序,取决于该应用的设计。ServicesA service doesnt have a visual user interface, but rather runs in the background for an indefinite period of time. For example, a service might
13、 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. 2:services服务是android中一个在后台运行的应用程序,没有可视化的用户界面。例如:你可以在使用一个用户程序的同时播放背景音乐。并且此时,播放音乐的
14、代码就不需要和用户交互,因此可以作为一个服务来运行,并且使用用户服务的接口来实现音乐的播放,暂停,等功能。对于不用向用户展示用户界面的情况下,使用服务是一个理想的选择。如同其他的组件一样,services运行于应用程序进程的主线程内。所以它不会对其他组件或用户界面有任何的妨碍,他们一般会派生一个新线程来执行一些时间消耗型的任务。Broadcast receivers A broadcast receiver is a component that does nothing but receive and react to broadcast announcements. Many broadc
15、asts originate in system code for example, announcements that the time zone 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 be
16、en 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 ma
17、y start an activity in response to the information they receive, or they may use the NotificationManager to alert the user. Notifications can get the users attention in various ways flashing the backlight, vibrating the device, playing a sound, and so on. They typically place a persistent icon in th
18、e status bar, which users can open to get the3:Broadcast receiverbroadcast receiver是一个与注于接收广播通知信息并做出相应处理的组件。许多广播是由系统代码产生的例如通知时区改变、电池电量低、拍摄了一张照片或者用户改变了语言选项。应用程序也可以发起广播例如通知其它应用程序一些数据已经下载到设备上并处于可用状态。 一个应用程序可以拥有任意数量的broadcast receiver以对所有它认为重要的通知信息予以响应。所有的receiver均继承自BroadcastReceiver基类。 broadcast recei
19、ver没有用户界面。然而它们可以启动一个activity来响应它们收到的信息或者也可以使用NotificationManager来通知用户。通知可以用多种方式来吸引用户的注意力闪动背光灯、震动设备、播放声音等等。通知一般是在状态栏上放一个持续的图标用户可以打开它并获取消息。Content providers A content provider makes a specific set of the applications data available to other applications. The data can be stored in the file system, in a
20、n 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.
21、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 thats involved. See the separate Content Providers document for more information on using content provid
22、ers. Whenever theres 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. 4:内容提供者content p
23、rovidercontent provider将一些特定的应用程序数据供给其它应用程序使用。数据可以存储于文件系统、SQLite数据库或其它有意义的方式。content provider继承于ContentProvider 基类实现了一套使得其他应用程序能够检索和存储它所管理类型数据的标准方法。然而应用程序并不直接调用返些方法而是使用一个 ContentResolver 对象调用它的方法作为替代。ContentResolver可以与任何content provider进行会话与其合作对任何相关的进程间通讯进行管理。 参阅独立的Content Providers文档以获得更多关于使用conten
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 有关 android 技术 英文 文献 翻译 16
限制150内