安卓 外文翻譯 模板_第1頁
安卓 外文翻譯 模板_第2頁
安卓 外文翻譯 模板_第3頁
安卓 外文翻譯 模板_第4頁
安卓 外文翻譯 模板_第5頁
已閱讀5頁,還剩5頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、北京郵電大學(xué)世紀(jì)學(xué)院畢業(yè)設(shè)計(jì)(論文)文獻(xiàn)翻譯題 目 基于Android的英語學(xué)習(xí)平臺(tái)的設(shè)計(jì)與實(shí)現(xiàn)學(xué)生姓名 徐光瑋 學(xué) 號 10030229 專業(yè)名稱 計(jì)算機(jī)科學(xué)與技術(shù) 年 級 2010級 指導(dǎo)教師 鄭凱梅 職 稱 副 教 授 所 在 系(院) 計(jì)算機(jī)科學(xué)與技術(shù)2014 年 12 月 10 日Android Developers By此處增加作者名字封皮的題目是畢業(yè)論文的題目,一定要和任務(wù)書、開題報(bào)告一致。標(biāo)題排版:黑體。四號,加粗,作者姓名黑體,小四,加粗英文正文排版要求:times new roman,小四,首行縮進(jìn)四個(gè)英文字符,行距1.5倍。中文標(biāo)題:黑體,四號,加粗,作者姓名,黑體,小四

2、,加粗。中文正文:宋體,小四,首行縮進(jìn)兩個(gè)中文字符,行距1.5倍。(排版完畢,刪除紅色文字)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. Th

3、is file 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.In many ways, each Android application lives in its own world:1. By default, every applica

4、tion runs in its own Linux process. Android starts the process when any of the applications code needs to be executed, and shuts down the process when its no longer needed and system resources are required by other applications.2. Each process has its own virtual machine (VM), so application code ru

5、ns 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 applications files are visible only to that user and only to the application itself although there are ways to export them to other applications

6、 as well.1 Application ComponentsA central feature of Android is that one application can make use of elements ofother 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 sc

7、roller 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 piece of the other application when the need arises.For this to

8、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 entry point for everything in the application (no main() function

9、, for example). Rather, they have essential components that the system can instantiate and run as needed. There are four types of components:1.1 ActivitiesAn activity presents a visual user interface for one focused endeavor the user can undertake.Each activity is given a default window to draw in.

10、Typically, the window fills the screen, but it might be smaller than the screen and float on top of other windows. 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. Paren

11、t 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 activitys interaction with the user takes place.A view hierarchy is placed wi

12、thin an activitys window by the Activity.setContentView() method. The content view is the View object at the root of the hierarchy.1.2 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 play backgrou

13、nd musicas 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.1.3 Broadcast receiversA broadcast receiver is a component that does nothing but receive and rea

14、ct 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 othe

15、r 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 dis

16、play 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 users attention in various ways flashing the backlight, vibrating the device, playing a sound, and so on. They

17、typically place a persistent icon in the status bar, which users can open to get the message.1.4 Content providersA content provider makes a specific set of the applications data available to other applications. The data can be stored in the file system, in an SQLite database, or in any other manner

18、 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

19、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.Whenever theres a request that should be handled by a particular component, Android makes sure that the application process of the

20、 component is running, starting it if necessary, and that an appropriate instance of the component is available, creating the instance if necessary.2 Activating components: intentsContent providers are activated when theyre targeted by a request from a ContentResolver. The other three components act

21、ivities, 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

22、 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, theIntent object names the action being announced. For example, it might announce to interested parties that the camera button has been pressed.There are separ

23、ate methods for activating each type of component:1. An activity is launched (or given something new to do) by passing an Intent object toContext.startActivity() or Activity.startActivityForResult(). The responding activity can look at the initial intent that caused it to be launched by calling its

24、getIntent() method. Android calls the activitys onNewIntent() method to pass it any subsequent intents.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 services onStart() method and passes it the In

25、tent object.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

26、onReceive() methods. For more on intent messages, see the separate article, Intents and Intent Filters.3 Shutting down componentsA content provider is active only while its responding to a request from a ContentResolver. And a broadcast receiver is active only while its responding to a broadcast mes

27、sage. So theres no need to explicitly shut down these components.Activities, on the other hand, provide the user interface. Theyre 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 fo

28、r 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 stopp

29、ed 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 ramif

30、ications in more detail.4 The manifest fileBefore Android can start an application component, it must learn that the component exists. Therefore, applications declare their components in a manifest file thats bundled into the Android package, the .apk file that also holds the applications code, file

31、s, 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 applications components, such as naming any libraries the application needs to be linked against (besides the default Android l

32、ibrary) and identifying any permissions the application expects to be granted.5 Intent filtersAn 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,

33、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 components intent filters inform Android of the kinds of intents the component is able to handle. Like other essential information about the compon

34、ent, theyre declared in the manifest file.A component can have any number of intent filters, each one declaring a different set of capabilities. If it doesnt have any filters, it can be activated only by intents that explicitly name the component as the target.For a broadcast receiver thats created

35、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.REFERENCES1 Johnson E E, Peach D F.NTIA Report 94-310: High Frequency Radio Chann

36、el Error ModelR.National Telecommunication and Inform ation Administration, ITS, 1994.2 lemmon J J.NTIA Report 02-394: Wireless Link Sta-tistical Bit Eror Model,R. NationalTelecommunication and Inform ation Administration, ITS, 2002,3 Mehdi Rostami, joaoAngeja, joao Tavares, An tonioNavaro. HF Chann

37、el Modeling for RealTime PacketTransmissionC/SPIE, 2003: 181-191.4 FanYang, RuiminShen, PengHan,RenTong, Zuwei Hu and Xia Wang, Growing interest-oriented learning communities for mobile-learnersJ, International Journalof ContinuingEngineering Education and Lifelong Learning, Vol.14 No.4/5, pp.422-43

38、45 Chabra, T., Figueiredo, J., (2002). How To Design and Deploy Handheld Learning.Android開發(fā)此處增加作者名字Android應(yīng)用程序使用Java編程語言開發(fā)。aapt工具把編譯后的Java代碼連同應(yīng)用程序所需的其他數(shù)據(jù)和資源文件一起打包到一個(gè)Android包文件中,這個(gè)文件使用.apk作為擴(kuò)展名。此文件是分發(fā)并安裝應(yīng)用程序到移動(dòng)設(shè)備的載體;是用戶下載到他們的設(shè)備的文件。單一.apk文件中的所有代碼被認(rèn)為是一個(gè)應(yīng)用程序。從多個(gè)角度來看,每個(gè)Android應(yīng)用程序都存在于它自己的世界之中:1、默認(rèn)情況下,每個(gè)應(yīng)

39、用程序均運(yùn)行于它自己的Linux進(jìn)程中。當(dāng)應(yīng)用程序中的任何代碼需要被執(zhí)行時(shí),Android啟動(dòng)此進(jìn)程,而當(dāng)不再需要此進(jìn)程并且其它應(yīng)用程序又請求系統(tǒng)資源時(shí),則關(guān)閉這個(gè)進(jìn)程(Android starts the process when any of the applications code needs to be executed, and shuts down the process when its no longer needed and system resources are required by other applications.)。 2、每個(gè)進(jìn)程都有其獨(dú)有的虛擬機(jī)(VM),

40、所以應(yīng)用程序代碼與所有其它應(yīng)用程序代碼是隔離運(yùn)行的。3、默認(rèn)情況下,每個(gè)應(yīng)用程序均被賦予一個(gè)唯一的Linux用戶ID,并加以權(quán)限設(shè)置,使得應(yīng)用程序的文件僅對此用戶及此應(yīng)用程序可見盡管也有其它的方法使得這些文件同樣能為其他應(yīng)用程序所訪問。1 應(yīng)用程序組件Android的一個(gè)核心特性就是一個(gè)應(yīng)用程序可以使用其它應(yīng)用程序的元素(如果那個(gè)應(yīng)用程序允許的話)。例如,如果你的應(yīng)用程序需要顯示一個(gè)圖片卷動(dòng)列表,而另一個(gè)應(yīng)用程序已經(jīng)開發(fā)了一個(gè)合用的而又允許別的應(yīng)用程序使用的話,你可以直接調(diào)用那個(gè)卷動(dòng)列表來完成工作,而不用自己再開發(fā)一個(gè)。你的應(yīng)用程序并沒有吸納或鏈接其它應(yīng)用程序的代碼。它只是在有需求的時(shí)候啟動(dòng)了

41、其它應(yīng)用程序的那個(gè)功能部分。為達(dá)到這個(gè)目的,系統(tǒng)必須能夠在一個(gè)應(yīng)用程序的任何一部分被需要時(shí)啟動(dòng)一個(gè)此應(yīng)用程序的進(jìn)程,并將那個(gè)部分的Java對象實(shí)例化。因此,不像其它大多數(shù)系統(tǒng)上的應(yīng)用程序,Android應(yīng)用程序并沒有為應(yīng)用程序提供一個(gè)單獨(dú)的入口點(diǎn)(比如說,沒有main()函數(shù)),而是為系統(tǒng)提供了可以實(shí)例化和運(yùn)行所需的必備組件。一共有四種組件類型:1.1 Activityactivity是為用戶操作而展示的可視化用戶界面(An activity presents a visual user interface for one focused endeavor the user can under

42、take.)。每個(gè)activity都被給予一個(gè)默認(rèn)的窗口以進(jìn)行繪制。一般情況下,這個(gè)窗口是滿屏的,但它也可以是一個(gè)小的位于其它窗口之上的浮動(dòng)窗口。窗口顯示的可視內(nèi)容是由一系列層次化view構(gòu)成的,這些view均繼承自 View 基類。每個(gè)view均控制著窗口中一塊特定的矩形區(qū)域。父級view包含并組織其子view的布局。葉節(jié)點(diǎn)view(位于層次結(jié)構(gòu)最底端)在它們控制的矩形區(qū)域中進(jìn)行繪制,并對用戶直達(dá)其區(qū)域的操作做出響應(yīng)。因此,view是activity與用戶進(jìn)行交互的界面。view層次結(jié)構(gòu)是由Activity.setContentView() 方法放入activity的窗口之中的(A view

43、 hierarchy is placed within an activitys window by the Activity.setContentView() method.)。content view是位于層次結(jié)構(gòu)根位置的View對象。1.2 Serviceservice沒有可視化的用戶界面,而是在一段時(shí)間內(nèi)在后臺(tái)運(yùn)行。例如,一個(gè)service可以在用戶做其它事情的時(shí)候在后臺(tái)播放背景音樂、從網(wǎng)絡(luò)上獲取數(shù)據(jù)或者計(jì)算一些東西并提供給需要這個(gè)運(yùn)算結(jié)果的activity使用。每個(gè)service都繼承自Service基類。1.3 Broadcast receiverbroadcast receive

44、r是一個(gè)與注于接收廣播通知信息,并做出相應(yīng)處理的組件。許多廣播是由系統(tǒng)代碼產(chǎn)生的例如,通知時(shí)區(qū)改變、電池電量低、拍攝了一張照片或者用戶改變了語言選項(xiàng)。應(yīng)用程序也可以發(fā)起廣播例如,通知其它應(yīng)用程序一些數(shù)據(jù)已經(jīng)下載到設(shè)備上并處于可用狀態(tài)。一個(gè)應(yīng)用程序可以擁有任意數(shù)量的broadcast receiver,以對所有它認(rèn)為重要的通知信息予以響應(yīng)。所有的receiver均繼承自BroadcastReceiver基類。broadcast receiver沒有用戶界面。然而,它們可以啟動(dòng)一個(gè)activity來響應(yīng)它們收到的信息,或者也可以使用NotificationManager來通知用戶。通知可以用多種方

45、式來吸引用戶的注意力閃動(dòng)背光燈、震動(dòng)設(shè)備、播放聲音等等。通知一般是在狀態(tài)欄上放一個(gè)持麗的圖標(biāo),用戶可以打開它并獲取消息。1.4 Content providercontent provider將一些特定的應(yīng)用程序數(shù)據(jù)供給其它應(yīng)用程序使用。數(shù)據(jù)可以存儲(chǔ)于文件系統(tǒng)、SQLite數(shù)據(jù)庫或其它有意的方式。content provider繼承于ContentProvider 基類,實(shí)現(xiàn)了一套使得其他應(yīng)用程序能夠檢索和存儲(chǔ)它所管理的類型數(shù)據(jù)的標(biāo)準(zhǔn)方法(The data can be stored in the file system, in an SQLite database, or in any ot

46、her 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.)。然而,應(yīng)用程序并不直接調(diào)用返些方法,而是使用一個(gè) ContentResolver 對象,調(diào)用它的方法作為替代。ContentResolver可以與任何content provi

47、der進(jìn)行會(huì)話;與其合作對任何相關(guān)的進(jìn)程間通訊進(jìn)行管理。每當(dāng)出現(xiàn)一個(gè)需要被特定組件處理的請求時(shí),Android會(huì)確保那個(gè)組件的應(yīng)用程序進(jìn)程處于運(yùn)行狀態(tài),必要時(shí)會(huì)啟動(dòng)它,并確保那個(gè)組件的一個(gè)合適的實(shí)例可用,必要時(shí)會(huì)創(chuàng)建那個(gè)實(shí)例。2 激活組件:intent當(dāng)接收到ContentResolver發(fā)出的請求后,content provider被激活。而其它三種組件activity、service和broadcast receiver,被一種叫做intent的異步消息所激活。intent是一個(gè)保存著消息內(nèi)容的Intent對象。對于activity和service來說,它指明了所請求的操作名稱,并指定了用

48、來操作的數(shù)據(jù)的URI和其它一些信息。例如,它可以承載一個(gè)對一個(gè)activity的請求,讓它為用戶顯示一張圖片,或者讓用戶編輯一些文本。而對于broadcast receiver來說,Intent對象指明了所通報(bào)的操作。例如,它可以對所有感興趣的對象通報(bào)照相按鈕被按下。對于每種組件來說,激活的方法是不同的:1、通過傳遞一IntentContext.startActivity()Activity.startActivityForResult(以啟動(dòng)(或指定新工作給)一個(gè)activity。相應(yīng)的activity可以通過調(diào)用自身的 getIntent() 方法來查看最刜激活它的intent。Andro

49、id通過調(diào)用activity的onNewIntent()方法來傳遞給它隨后的任何intent。2、通過傳遞一個(gè)Intent對象至Context.startService()以啟動(dòng)一個(gè)service(或向正在運(yùn)行的service給出一個(gè)新的指令)。Android調(diào)用此service的 onStart()方法并將Intent對象傳遞給它。3、應(yīng)用程序可以通過傳遞一個(gè)Intent對象至 Context.sendBroadcast() ,Context. sendOrderedBroadcast(), 以及Context.sendStickyBroadcast()和其它類似方法來發(fā)起一個(gè)廣播。Android會(huì)調(diào)用所有對此廣播有興趣的broadcast receiver的 onReceive()方法,將此intent傳遞給它們。 3 關(guān)閉組件content provider僅在響應(yīng)來自ContentResolver的請求時(shí)處于活動(dòng)狀態(tài)。而broadcast receiver僅在響應(yīng)一條廣播信息的時(shí)候處于活動(dòng)狀態(tài)。所以沒有必要去顯式地關(guān)閉返些組件。而activit

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論