毕业设计android毕业论文英文翻译
本作品内容为毕业设计android毕业论文英文翻译,格式为 doc ,大小 67624 KB ,页数为 16页
('ApplicationFundamentalsAndroidapplicationsarewrittenintheJavaprogramminglanguage.ThecompiledJavacode—alongwithanydataandresourcefilesrequiredbytheapplication—isbundledbytheaapttoolintoanAndroidpackage,anarchivebyan.apksuffix.Thisthevehiclefordistributingtheapplicationandinstallingitonmobiledevices;it\'sthedownloadtotheirdevices.Allthecodeinasingle.apkconsideredtobeoneapplication.Inmanyways,eachAndroidapplicationlivesinitsownworld:1.Bydefault,everyapplicationrunsinitsownLinuxprocess.Androidstartstheprocesswhenanyoftheapplication\'scodeneedstobeexecuted,andshutsdowntheprocesswhenit\'snolongerneededandsystemresourcesarerequiredbyotherapplications.2.Eachprocesshasitsownvirtualmachine(VM),soapplicationcoderunsinisolationfromthecodeofallotherapplications.3.Bydefault,eachapplicationisassignedauniqueLinuxuserID.Permissionsaresetsothattheapplication\'sfilesarevisibleonlytothatuserandonlytotheapplicationitself—althoughtherearewaystoexportthemtootherapplicationsaswell.It\'spossibletoarrangefortwoapplicationstosharethesameuserID,inwhichcasetheywillbeabletoseeeachother\'sfiles.Toconservesystemresources,applicationswiththesameIDcanalsoarrangetoruninthesameLinuxprocess,sharingthesameVM.ApplicationComponentsAcentralfeatureofAndroidisthatoneapplicationcanmakeuseofelementsofotherapplications(provided第0页thoseapplicationspermitit).Forexample,ifyourapplicationneedstodisplayascrollinglistofimagesandanotherapplicationhasdevelopedasuitablescrollerandmadeitavailabletoothers,youcancalluponthatscrollertodothework,ratherthandevelopyourown.Yourapplicationdoesn\'tincorporatethecodeoftheotherapplicationorlinktoit.Rather,itsimplystartsupthatpieceoftheotherapplicationwhentheneedarises.Forthistowork,thesystemmustbeabletostartanapplicationprocesswhenanypartofitisneeded,andinstantiatetheJavaobjectsforthatpart.Therefore,unlikeapplicationsonmostothersystems,Androidapplicationsdon\'thaveasingleentrypointforeverythingintheapplication(nomain()function,forexample).Rather,theyhaveessentialcomponentsthatthesystemcaninstantiateandrunasneeded.Therearefourtypesofcomponents:ActivitiesAnactivitypresentsavisualuserinterfaceforonefocusedendeavortheusercanundertake.Forexample,anactivitymightpresentalistofmenuitemsuserscanchoosefromoritmightdisplayphotographsalongwiththeircaptions.Atextmessagingapplicationmighthaveoneactivitythatshowsalistofcontactstosendmessagesto,asecondactivitytowritethemessagetothechosencontact,andotheractivitiestoreviewoldmessagesorchangesettings.Thoughtheyworktogethertoformacohesiveuserinterface,eachactivityisindependentoftheothers.EachoneisimplementedasasubclassoftheActivitybaseclass.Anapplicationmightconsistofjustoneactivityor,likethetextmessagingapplicationjustmentioned,itmaycontainseveral.Whattheactivitiesare,andhowmanytherearedepends,ofcourse,ontheapplicationand第1页itsdesign.Typically,oneoftheactivitiesismarkedasthefirstonethatshouldbepresentedtotheuserwhentheapplicationislaunched.Movingfromoneactivitytoanotherisaccomplishedbyhavingthecurrentactivitystartthenextone.Eachactivityisgivenadefaultwindowtodrawin.Typically,thewindowfillsthescreen,butitmightbesmallerthanthescreenandfloatontopofotherwindows.Anactivitycanalsomakeuseofadditionalwindows—forexample,apop-updialogthatcallsforauserresponseinthemidstoftheactivity,orawindowthatpresentsuserswithvitalinformationwhentheyselectaparticularitemon-screen.Thevisualcontentofthewindowisprovidedbyahierarchyofviews—objectsderivedfromthebaseViewclass.Eachviewcontrolsaparticularrectangularspacewithinthewindow.Parentviewscontainandorganizethelayoutoftheirchildren.Leafviews(thoseatthebottomofthehierarchy)drawintherectanglestheycontrolandrespondtouseractionsdirectedatthatspace.Thus,viewsarewheretheactivity\'sinteractionwiththeusertakesplace.Forexample,aviewmightdisplayasmallimageandinitiateanactionwhentheusertapsthatimage.Androidhasanumberofready-madeviewsthatyoucanuse—includingbuttons,textfields,scrollbars,menuitems,checkboxes,andmore.Aviewhierarchyisplacedwithinanactivity\'swindowbytheActivity.setContentView()method.ThecontentviewistheViewobjectattherootofthehierarchy.(SeetheseparateUserInterfacedocumentformoreinformationonviewsandthehierarchy.)ServicesAservicedoesn\'thaveavisualuserinterface,butratherrunsinthebackgroundforanindefiniteperiodof第2页time.Forexample,aservicemightplaybackgroundmusicastheuserattendstoothermatters,oritmightfetchdataoverthenetworkorcalculatesomethingandprovidetheresulttoactivitiesthatneedit.EachserviceextendstheServicebaseclass.Aprimeexampleisamediaplayerplayingsongsfromaplaylist.Theplayerapplicationwouldprobablyhaveoneormoreactivitiesthatallowtheusertochoosesongsandstartplayingthem.However,themusicplaybackitselfwouldnotbehandledbyanactivitybecauseuserswillexpectthemusictokeepplayingevenaftertheyleavetheplayerandbeginsomethingdifferent.Tokeepthemusicgoing,themediaplayeractivitycouldstartaservicetoruninthebackground.Thesystemwouldthenkeepthemusicplaybackservicerunningevenaftertheactivitythatstarteditleavesthescreen.It\'spossibletoconnectto(bindto)anongoingservice(andstarttheserviceifit\'snotalreadyrunning).Whileconnected,youcancommunicatewiththeservicethroughaninterfacethattheserviceexposes.Forthemusicservice,thisinterfacemightallowuserstopause,rewind,stop,andrestarttheplayback.Likeactivitiesandtheothercomponents,servicesruninthemainthreadoftheapplicationprocess.Sothattheywon\'tblockothercomponentsortheuserinterface,theyoftenspawnanotherthreadfortime-consumingtasks(likemusicplayback).SeeProcessesandThreads,later.BroadcastreceiversAbroadcastreceiverisacomponentthatdoesnothingbutreceiveandreacttobroadcastannouncements.Manybroadcastsoriginateinsystemcode—forexample,announcementsthatthetimezonehaschanged,thatthebatteryislow,thatapicturehasbeentaken,orthattheuserchangedalanguagepreference.Applicationscanalsoinitiatebroadcasts—forexample,toletother第3页applicationsknowthatsomedatahasbeendownloadedtothedeviceandisavailableforthemtouse.Anapplicationcanhaveanynumberofbroadcastreceiverstorespondtoanyannouncementsitconsidersimportant.AllreceiversextendtheBroadcastReceiverbaseclass.Broadcastreceiversdonotdisplayauserinterface.However,theymaystartanactivityinresponsetotheinformationtheyreceive,ortheymayusetheNotificationManagertoalerttheuser.Notificationscangettheuser\'sattentioninvariousways—flashingthebacklight,vibratingthedevice,playingasound,andsoon.Theytypicallyplaceapersistenticoninthestatusbar,whichuserscanopentogetthemessage.ContentprovidersAcontentprovidermakesaspecificsetoftheapplication\'sdataavailabletootherapplications.Thedatacanbestoredinthe,inanSQLitedatabase,orinanyothermannerthatmakessense.ThecontentproviderextendstheContentProviderbaseclasstoimplementastandardsetofmethodsthatenableotherapplicationstoretrieveandstoredataofthetypeitcontrols.However,applicationsdonotcallthesemethodsdirectly.RathertheyuseaContentResolverobjectandcallitsmethodsinstead.AContentResolvercantalktoanycontentprovider;itcooperateswiththeprovidertomanageanyinterprocesscommunicationthat\'sinvolved.SeetheseparateContentProvidersdocumentformoreinformationonusingcontentproviders.Wheneverthere\'sarequestthatshouldbehandledbyaparticularcomponent,Androidmakessurethattheapplicationprocessofthecomponentisrunning,startingitifnecessary,andthatanappropriateinstanceofthecomponentisavailable,creatingtheinstanceifnecessary.第4页Activatingcomponents:intentsContentprovidersareactivatedwhenthey\'retargetedbyarequestfromaContentResolver.Theotherthreecomponents—activities,services,andbroadcastreceivers—areactivatedbyasynchronousmessagescalledintents.AnintentisanIntentobjectthatholdsthecontentofthemessage.Foractivitiesandservices,itnamestheactionbeingrequestedandspecifiestheURIofthedatatoacton,amongotherthings.Forexample,itmightconveyarequestforanactivitytopresentanimagetotheuserorlettheusereditsometext.Forbroadcastreceivers,theIntentobjectnamestheactionbeingannounced.Forexample,itmightannouncetointerestedpartiesthatthecamerabuttonhasbeenpressed.Thereareseparatemethodsforactivatingeachtypeofcomponent:1.Anactivityislaunched(orgivensomethingnewtodo)bypassinganIntentobjecttoContext.startActivity()orActivity.startActivityForResult().TherespondingactivitycanlookattheinitialintentthatcausedittobelaunchedbycallingitsgetIntent()method.Androidcallstheactivity\'sonNewIntent()methodtopassitanysubsequentintents.Oneactivityoftenstartsthenextone.Ifitexpectsaresultbackfromtheactivityit\'sstarting,itcallsstartActivityForResult()insteadofstartActivity().Forexample,ifitstartsanactivitythatletstheuserpickaphoto,itmightexpecttobereturnedthechosenphoto.TheresultisreturnedinanIntentobjectthat\'spassedtothecallingactivity\'sonActivityResult()method.2.Aserviceisstarted(ornewinstructionsaregiventoanongoingservice)bypassinganIntentobjecttoContext.startService().Androidcallstheservice\'s第5页onStart()methodandpassesittheIntentobject.Similarly,anintentcanbepassedtoContext.bindService()toestablishanongoingconnectionbetweenthecallingcomponentandatargetservice.TheservicereceivestheIntentobjectinanonBind()call.(Iftheserviceisnotalreadyrunning,bindService()canoptionallystartit.)Forexample,anactivitymightestablishaconnectionwiththemusicplaybackservicementionedearliersothatitcanprovidetheuserwiththemeans(auserinterface)forcontrollingtheplayback.TheactivitywouldcallbindService()tosetupthatconnection,andthencallmethodsdefinedbytheservicetoaffecttheplayback.Alatersection,Remoteprocedurecalls,hasmoredetailsaboutbindingtoaservice.3.AnapplicationcaninitiateabroadcastbypassinganIntentobjecttomethodslikeContext.sendBroadcast(),Context.sendOrderedBroadcast(),andContext.sendStickyBroadcast()inanyoftheirvariations.AndroiddeliverstheintenttoallinterestedbroadcastreceiversbycallingtheironReceive()methods.Formoreonintentmessages,seetheseparatearticle,IntentsandIntentFilters.ShuttingdowncomponentsAcontentproviderisactiveonlywhileit\'srespondingtoarequestfromaContentResolver.Andabroadcastreceiverisactiveonlywhileit\'srespondingtoabroadcastmessage.Sothere\'snoneedtoexplicitlyshutdownthesecomponents.Activities,ontheotherhand,providetheuserinterface.They\'reinalong-runningconversationwiththeuserandmayremainactive,evenwhenidle,aslongastheconversationcontinues.Similarly,servicesmayalsoremainrunningforalongtime.SoAndroidhasmethodstoshutdownactivitiesandservicesinan第6页orderlyway:1.Anactivitycanbeshutdownbycallingitsfinish()method.Oneactivitycanshutdownanotheractivity(oneitstartedwithstartActivityForResult())bycallingfinishActivity().2.AservicecanbestoppedbycallingitsstopSelf()method,orbycallingContext.stopService().ComponentsmightalsobeshutdownbythesystemwhentheyarenolongerbeingusedorwhenAndroidmustreclaimmemoryformoreactivecomponents.Alatersection,ComponentLifecycles,discussesthispossibilityanditsramificationsinmoredetail.ThemanifestAndroidcanstartanapplicationcomponent,itmustlearnthatthecomponentexists.Therefore,applicationsdeclaretheircomponentsinamanifest\'sbundledintotheAndroidpackage,the.apkalsoholdstheapplication\'scode,files,andresources.ThemanifestisastructuredXMLisalwaysnamedAndroidManifest.xmlforallapplications.Itdoesanumberofthingsinadditiontodeclaringtheapplication\'scomponents,suchasnaminganylibrariestheapplicationneedstobelinkedagainst(besidesthedefaultAndroidlibrary)andidentifyinganypermissionstheapplicationexpectstobegranted.ButtheprincipaltaskofthemanifestistoinformAndroidabouttheapplication\'scomponents.Forexample,anactivitymightbedeclaredasfollows:Thenameattributeofthe
提供毕业设计android毕业论文英文翻译会员下载,编号:1700719003,格式为 docx,文件大小为16页,请使用软件:wps,office word 进行编辑,PPT模板中文字,图片,动画效果均可修改,PPT模板下载后图片无水印,更多精品PPT素材下载尽在某某PPT网。所有作品均是用户自行上传分享并拥有版权或使用权,仅供网友学习交流,未经上传用户书面授权,请勿作他用。若您的权利被侵害,请联系963098962@qq.com进行删除处理。