版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1、畢業(yè)設(shè)計(論文)中英文對照資料外文翻譯文獻(xiàn)(此文檔為word格式,下載后您可任意編輯修改?。┮?、外文翻譯是畢業(yè)設(shè)計(論文)的主要內(nèi)容之一,必須學(xué)生獨立完成。2、外文翻譯譯文內(nèi)容應(yīng)與學(xué)生的專業(yè)或畢業(yè)設(shè)計(論文)內(nèi)容相關(guān),不得少于xxxx 卬刷符號。3、外文翻譯譯文用a4紙打印,需包含中文翻譯和英文原文。4、年月日等的填寫,用阿拉伯?dāng)?shù)字書寫,要符合關(guān)于出版物上數(shù)字用法的試行規(guī) 定,如“2017年5月26日”。5、所有簽名必須手寫,不得打印。附件:外文原文application fundamentalsandroid applications are written in the java pr
2、ogramming 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 devic
3、es; it*s the file users download to their devices all the code in a single .apk file is considered to be one applicationin 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&
4、#39;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 applications3. by default, each applic
5、ation 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 sam
6、e 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 componentsa central feature of android is that one application can make use of elem
7、ents 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 deve
8、lop 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 in
9、stantiate 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
10、 as needed there are four types of components:activitiesan 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 mess
11、aging 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 ind
12、ependent of the others. each one is implemented as a subclass of the activity base classan 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 applica
13、tion 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 dra
14、w 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 wit
15、h 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
16、 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 wh
17、en the user taps that image. android has a number of readymade views that you can use 一 including buttons, text fields, scroll bars, menu items, check boxes, and morea view hierarchy is placed within an activity's window by the activity.setcontentview() method the content view is the view object
18、 at the root of the hierarchy. (see the separate user interface document formore information on views and the hierarchy.)servicesa 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
19、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
20、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,
21、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 its not already run
22、ning). 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 applic
23、ation 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.broadcast receiversa broadcast receiver is a component that does nothing but receive and react to broad
24、cast 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 appli
25、cations 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
26、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 t
27、ypically place a persistent icon in the status bar, which users can open to get the messagecontent providersa 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
28、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 an
29、d call its methods instead. a contentresolver can talk to any content provider; it cooperates with the provider to manage any interprocess communication that's involvedsee the separate content providers document for more information on using content providers.whenever there's a request that
30、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. activating components: intentscontent providers are
31、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
32、, 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 theuser edit some text. for broadcast receivers, theintent object names the action being announced. for
33、 example, it might announce to interested parties that the camera button has been pressedthere 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 tocontext.startactivityo or activity.startactivityforresult(
34、). the responding activity can look at the initial intent that caused it to be launched by calling its getlntent() 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 if
35、 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 onactivityresu
36、lt() 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
37、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
38、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 det
39、ails 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 receive
40、rs by calling their onreceive() methods for more on intent messages, see the separate article, intents and intent filters.shutting down componentsa 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 re
41、sponding to a broadcast message so therefs 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, serv
42、ices may also remain running for a long time. so android has methods to shut downactivities 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 finishactivit
43、y().2. a service can be stopped by calling its stopself() method, or by calling context, stops ervice().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
44、this possibility and its ramifications in more detail.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 that's bundled into the android package, the .apk file that also
45、holds the application's code, files, and resourcesthe 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 lin
46、ked against (besides the default android library) and identifying any permissions the application expects to be grantedbut the principal task of the manifest is to inform android about the application's components. for example, an activity might be declared as follows:<?xml version="1.0&
47、quot; encoding="utf-8"?><manifest a<application . ><activity android:name=jectfreneticactivity”android:icon=n ?drawable/smallpicpng* android:label=h?string/freneticlabel"></activity> </application</manifest>the name attribute of the <
48、activity> 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 activitythe other components are declared in a similar way 一 <service> elements for
49、services, <receiver> elements for broadcast receivers, and <provider> 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 mn. however, broadcast receivers can either be
50、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.intent filtersan intent object
51、 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
52、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, theyfre declared in the manifest file. here's an extension of the previous example that adds two
53、intent filters to the activity:<?xml version=,1.0n encoding="utf-8"?><manifest <application . ><activity android: name= ent-action mainn and the ent.category.launchern 一 is a common one. it marks com. example. project. frmneticactivity"
54、 android: icon=" 0 drawable/small jic. pngf android: label=!,?s tring/frenm ti claber*:><intent-filter >vaction android:name="gnt.action.main" /><category android:name=entcategory.launcherthe first filter in the example 一 the combination of the ac
55、tion* /> </intent-filter> <intent-filter ><action android:name=ject.bounce11 /><data android:mimetype="image/jpegn /><category android:name=,enttegory.default" /> </intent-filter></activity> </application</manife
56、st>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
57、second filter declares an action that the activity can perform on a particular type of dataa 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
58、 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 manifestfor more on intent filters, see a separate document, intents and intent filters.附件:外文資料翻譯譯文應(yīng)用程序基礎(chǔ)androi
59、d developersandroid應(yīng)用程序使用java編程語言開發(fā)。aapt工具把編譯后的java代碼連同應(yīng)用程序所需的其他數(shù)據(jù)和資源文件一起打包到一個android包文件中,這個文件使用apk作為擴(kuò)展名。此文件是分發(fā)并安 裝應(yīng)用程序到移動設(shè)備的載體;是用戶下載到他們的設(shè)備的文件。單 一apk文件中的所有代碼被認(rèn)為是一個應(yīng)用程序。從多個角度來看,每個android應(yīng)用程序都存在于它自己的世界之 中:1默認(rèn)情況下,每個應(yīng)用程序均運行于它自己的linux進(jìn)程中。 當(dāng)應(yīng)用程序中的任何代碼需要被執(zhí)行時,android啟動此進(jìn)程,而當(dāng)不 再需要此進(jìn)程并且其它應(yīng)用程序又請求系統(tǒng)資源時,則關(guān)閉這個進(jìn)程。2每個進(jìn)程都有其獨有的虛擬機(jī)(vm),所以應(yīng)用程序代碼與 所有其它應(yīng)用程序代碼是隔離運行的。3默認(rèn)情況下,每個應(yīng)用程序均被賦予一個唯一的linux用戶id,并加以權(quán)限設(shè)置,使得應(yīng)用程序的文件僅對此用戶及此應(yīng)用程序可 見盡管也有其它的方法使得這些文件同樣能為其他應(yīng)用程序所訪 問。1應(yīng)用程序組件android的一個核心特性就是一個應(yīng)用程序可以使用其它應(yīng)用程序 的元素(如果那個應(yīng)用程序允許的話)。例如,如果你的應(yīng)用程序需要 顯示一個圖片卷動列表,而另一個應(yīng)用程序已經(jīng)開發(fā)了一個合用的而又 允許別的應(yīng)用程序使用的話,你可以直接調(diào)用那個卷動列表來完成工 作,而不用自己再開發(fā)一個
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年版房地產(chǎn)買賣合同模板
- 2024年港口疏浚及堤壩修建合同3篇
- 勞動合同書電子版
- 水甲苯精餾塔課程設(shè)計
- 插班課程設(shè)計案例分析
- 管道課程設(shè)計小結(jié)
- 航空物流課程設(shè)計
- 航天研學(xué)課程設(shè)計
- 烘焙網(wǎng)絡(luò)營銷課程設(shè)計
- 機(jī)械小車課程設(shè)計
- 【發(fā)動機(jī)曲軸數(shù)控加工工藝過程卡片的設(shè)計7800字(論文)】
- 中藥破壁飲片文稿專家講座
- 2025年高考語文備考之名著閱讀《鄉(xiāng)土中國》重要概念解釋一覽表
- JG197-2006 預(yù)應(yīng)力混凝土空心方樁
- 醫(yī)院護(hù)理培訓(xùn)課件:《安全注射》
- 變、配電室門禁管理制度
- 11304+《管理案例分析》紙考2023.12
- 《淺談跳繩體育游戲的實踐研究》 論文
- 《勇敢面對挫折和困難》參考課件
- 小學(xué)體育期末檢測方案
- 2023-2024學(xué)年福建省莆田市荔城區(qū)中山中學(xué)、九中聯(lián)考九年級(上)期末數(shù)學(xué)試卷
評論
0/150
提交評論