华中科技大学硕士学位论文Android平台环境下应用程序架构的设计与实现姓名:罗震申请学位级别:硕士专业:工业工程指导教师:黄金国20090523I23GAndroidAndroidGoogleLinuxAPIAndroidGTalkAndroidIIAbstractTherapiddevelopmentofwirelesscommunicationandinternettechnology,aswellastheirfusiondirectlyresultintherapiddemandincreaseofsmartphone.Inthepastyear,theglobalsalesvolumesofsmartphonereachnearly200,000,000,andthetrendofdevelopmentisincreasinglyevidentandtheforegroundofmarketisbright.Withthedevelopmentof3Gtechnology,thefunctionsofsmartphonebecomemoreandmorestrong,andcustomers’desiretosmartphonebecomesmoreandmorehigh,whichdirectlyresultinthenecessarythatthequalityandefficiencyofsoftwaredevelopmentonsmartphonesshouldgetmoreimportance.However,thecontradictionsbetweensoftwarecomplexityanddevelopmentcycle,betweenlimitationofsystemsourceandthediversificationoffunctionsandbetweendownloadfromnetandsecuritycausethetraditionalmodetobecomeaseriousobstacleofsoftwaredevelopmentonsmartphones.Inordertoimprovethedevelopmentqualityandefficiencyofsoftwareonsmartphone,thisthesisproposesawaythatdesignsamiddlearchitecturebetweentheupperapplicationandthelowerplatformsoastoformacomparativelystableframeworkofsoftwaredevelopment.Thisarticlefirstmakeaanalysisofthesoftwarearchitecturetheories,thenmakeaseriousconsiderationintheprincipleofcoherenceandthereliability,basedonwhichwedividethewholearchitectureintofourlayers,andtheyareapplicationlayer,securitylayer,businesslayerandadaptivelayerintheorderthatfromuptodown,whicharerespectivelyindependenttootherlayers.Theapplicationlayerisresponsiblefortheinitialization,closeofapplicationandthetaskofrelatedcontrollers.Thesecuritylayerisresponsibleforprotectingdatasoastokeepvirusandtrojanfromattackingthesystem.Thebusinesslayerisresponsibleforthepackagingofvariousapplicationbusinesses,andprovidestheservicefortheapplicationlayer.Theadaptivelayerisresponsibleforthedatainteractionwithprotocolstack.Inthisthesis,thetestchoosesAndroidplatform.AndroidisanopensourcecellphoneplatformbasedonLinuxplatformdevelopedbyGoogle,whichprovidesusaseriesofAPIanddevelopmenttoolkits.Itcontainsoperatingsystem,userinterfaceandapplicationsallthesoftwarethecellphoneneedsduringoperation,andthere'snoobstacleinexclusiverightsthatcounteractstheinnovationofmobileindustry.IIIIntheendofthisthesis,applyingtoarchitecture,aninstantmessagingsoftwarenamedGtalkisdeveloped,andtheapplicabilityoftheframeworkisconfirmed.KeyWords:Androidplatform;softwarearchitecture;layeredmode;messagemapping;business-brokerobjectIII111.1[1]1.1.13G[2]4GPC[3][4]GoogleAndroid9AndroidG1IDCInternetDataCenter[4]100%1.1.221[5]+2[6]6[7]1.2[7]123[8][9]3[10]AndroidGTalkAndroidGtalk1-11.3(1)(2)(3)4(4)GoogleTalk(5)1.4AndroidGtalk522.12.1.1[16]:[16][16]:(1)LayersmodeBlackboardmodePipes/Filtersmode-Server-Client(2)ReflectionmodeMicrokernelmode3SOASOA,,6SOA,(4)MVCPACMVC(Model-View-Controller),MVC:ModelViewController2.1.2[18]:(a):WindowsJZEE(b):(c)(d)(e)(f)(g)(h)72.1.32001SandraHaseloff[19][19]WAP2-11238DONDEDONDE2007[20]Multi-layerGridProtalArchitectureBasedonMobileAgent2-2[20]WebWebGPDKGPDKJavaBeansGPDKJavaBeans9.........SSLHTTPsGSI2-2IBMAglet10CPU//2003GuoyouZhangYinzhangGuo[21]112-3Laddaga12312GCWC[19]1(a)(b)(c)2ERPCSCW3456132-431SabdraHaseloff2DONDEDONDE1432.21533.13.1.1[28]1JJ-1N[29]3.1.2[30]MarkovNiLiLRiU16,jkL,RjkL,jkVsR,,111(,(R,)ijkNNNsLiLjkijkRpowRUpowV====×∏∏∏1iL(i=1,2,N)N,jkLjLkL1N2......N-1,1,111,2,111,1221,111,22,1(,(,)(,)(,)(,)(,)(,)iiiiiNNNNNsLiLiiiiNLiiLLiLNLNNRpowRUpowRVpowRVpowRUpowRVpowRUpowRV+−−−−+==−−=−=××××××∏∏∏2,1iiV+,1iiV−iL1iL+1iL−N0~1173.23.1javajavajava[33][19]Application_Layer(Security_Layer)Business_Layer(Adapter_Layer)4[29]3-13.2.1Android_Application1Android#defineActivity_CameramCam#defineActivity_GTalkmGtalk3-118#defineActivity_GEarthmGEar#defineActivity_MMSmMMS/*Multi-MessageService*/2windowslinux[32]CPUABCACBABC3-2191N2...3-3203.2.2Android_Security1[34]Java.langGetSecurityManager()Windows[35]Java212IDSecurity_Manager=TheFirstIdSecurity_ByteCodeVeri=TheSecondIdSecurity_Encryption=TheThirdIdSecurity_ClassPlugIn=TheFourthIdSecurity_SandBox=TheFifthId3.2.3Android_Business1#defineBusiness_MessagemMessage#defineBusiness_AlermmAlerm#defineBusiness_ClockmClock22220(Business-BrokerObject)1212NN...3-43.2.4Android_AdapterIDService_ID=getServiceID(Service_Name)Adapter_ID=getAdapterID(Adapter_Name)adapterBind(Adapter_ID,Service_ID)233.3Android244AndroidGoogleTalkJavaDalvikDalviklinuxGtalkGoogleTalkGoogleQQQQGtalkQQGtalkGmailGoogleGmailGoogleTalkGmailGoogleTalkJabberXMPPIMGmail4.14.1.1[44]20QQICQPOPOMSNJabberHiQQQQ[45]254.1.2123456Gtalk4.2AndroidAndroid[32]GoogleLinuxGoogleAndroidT-Mobile30Google4.2.1AndroidAndroid[41]1.2.Dalvik263.,WebKit4.,2D;OpenGLES1.0()3D5.SQLite6.audio,video,(MPEG4,H.264,MP3,AAC,AMR,JPG,PNG,GIF)7.GSM()8.,EDGE,3GWiFi()9.Camera,GPS,,()10.,,,Eclipse4.2.2AndroidAndroid[41]4-1Android271Android,email,,,,,Java2,APIs.,,,:1.,View,Viewlist,grid,,,2.,(),3.,layout4.,5.,3AndroidC/C++,AndroidAndroid:1.CBSD-derivedC(libc),Linux2.PacketVideoOpenCORE;,,MPEG4,H.264,MP3,AAC,AMR,JPG,PNG3.2D3D4.web,Androidwebview5.SGL-2D