关闭

关闭

封号提示

内容

首页 [android.开发书籍].Practical.Android.Projects.pdf

[android.开发书籍].Practical.Android.Projects.pdf

[android.开发书籍].Practical.Androi…

上传者: appleflashstudio 2011-03-24 评分 5 0 335 46 1524 暂无简介 简介 举报

简介:本文档为《[android.开发书籍].Practical.Android.Projectspdf》,可适用于IT/计算机领域,主题内容包含JordanGreylingPracticalAndroidProjectsCompanioneBookAvailablePracticalAndr符等。

JordanGreylingPracticalAndroidProjectsCompanioneBookAvailablePracticalAndroidProjectsTrim:xspine="pagecountppiBuildingcoolscripts,apps,andgamesforAndroidSmartphonesLucasJordan|PieterGreylingCOMPANIONeBOOKSEELASTPAGEFORDETAILSON$eBOOKVERSIONUS$ShelveinMobileComputingUserlevel:IntermediateAdvancedwwwapresscomSOURCECODEONLINEBOOKSFORPROFESSIONALSBYPROFESSIONALSISBNthisprintforcontentonlysizecolornotaccurateCYANMAGENTAYELLOWBLACKPANTONECSPOTMATTETakeapracticalapproachtobecomingaleadingedgeAndroiddeveloper,learningbyexamplewhilecombiningthemanytechnologiesneededtocreateasuccessful,uptodatewebappPracticalAndroidProjectsintroducestheAndroidSDKanddevelopmenttoolsofthetrade,andthendivesintobuildingcoollookingandfunappsthatputAndroid’samazingcapabilitiestoworkAndroidisthepowerful,fullfeatured,opensourcemobileplatformthatpowersphoneslikeGoogleNexus,MotorolaDroid,SamsungGalaxyS,andavarietyofHTCphonesandtabletcomputersThisbookhelpsyouquicklygetAndroidprojectsupandrunningwiththefreeandopensourceEclipse,NetBeans,andIntelliJIDEAIDEsThenyoubuildandextendmobileapplicationsusingtheAndroidSDK,Java,ScriptingLayerforAndroid,andlanguagessuchasPython,Ruby,JavascriptHTML,FlexAIR,andLuaInPracticalAndroidProjectsyou’llworkonrealworldprojectssuchas:•HostinganAndroidBASICinterpreter•ExtendingyourJavabasedAndroidapplicationswithembeddedLUA•ScriptingyourAndroiddevicewithSLA•AddingTwitterandFacebooktoyourapplications•UsingDgraphicsandanimationsforcasualgames•CreatingcrossplatformappswithJavaScriptHTMLandFlexwithAIRPracticalAndroidProjectsisforanydevelopernewtotheAndroidplatformwhowantstolearntobuildmobileapplicationsKnowledgeofthefundamentalsofJavaprogrammingisassumedISBNForyourconvenienceApresshasplacedsomeofthefrontmattermaterialaftertheindexPleaseusetheBookmarksandContentsataGlancelinkstoaccessthemDownloadfromWow!eBook<wwwwowebookcom>ivContentsataGlanceContentsvAbouttheAuthorsxAbouttheTechnicalReviewerxiAcknowledgmentsxiiPrefacexiiiChapter:AndroidFundamentalsChapter:DevelopmentToolsinPracticeChapter:RollYourOwnAndroidScriptingEnvironmentChapter:EmbeddingLuainAndroidApplicationsChapter:IntroducingSLA:TheScriptingLayerforAndroidChapter:CreatingaGUIwithHTMLJavaScriptandAIRChapter:UsingRESTwithFacebookandTwitterChapter:UsingtheGoogleAppEnginewithAndroidChapter:GameDevelopment:GraphicsChapter:GameDevelopment:AnimationChapter:AppInventorIndexChapterAndroidFundamentalsTheAndroidplatformisaveryexcitingyetrelativelynewplayerintoday’smobiledevicemarketBeyondratingveryhighlyinthenumberofcoolfeaturesperdevice,AndroidenabledsmartphonesarecurrentlyenjoyingthehighestpercentagesalesgrowthrateinthemobileindustryAccordingtoGartnerResearch,worldwidesalesofAndroidbasedsmartphonestoendusershavejumpedfromthenumberspotintonumberbytheendofthefirstquarterofThislevelofgrowthisexpectedtocontinueInfact,GartnerhaspredictedthatAndroidwillbecomethenumberworldwidemobileoperatingsysteminandwillchallengeSymbianforthenumberpositionbyWewanttosharewithyousomeoftheenthusiasmwehaveforthistrulyremarkabledevelopmentplatformThroughoutthecourseofthisbook,wewillattempttodothisbyshowingthewiderangeofopportunitiesavailableatyourfingertipswhenyouchoosetodevelopAndroidapplicationsPerhapsyouarereadingthisbookinordertogainmorebackgroundunderstandingoftheAndroidplatformPerhapsyouplantorollupyoursleevesandjoinusinrunningandplayingwiththeprojectsintheemulatororyourowndeviceWewanttogetyouupandrunningquicklyandprovideyouwithsufficientunderstandingoftheAndroidplatformandAndroidDevelopmentKit(ADK)developmentenvironmenttohavesuccesswithyourgoalsWiththosegoalsinmind,thischapteraimstobeaspracticalanintroductiontoAndroiddevelopmentaspossibleItalsostrivestocoverabroadspectrumofrequiredconceptualandtheoreticalbackgroundmaterialinaconciseandtothepointmannerWewillstartwithashortdescriptionoftheAndroidplatformandthenjumpstraightintocoverageoftheinstallationoftheAndroidSDKandsupportingdevelopmenttoolsTofullyroundoutourSDKsetupstudy,weembarkonastepbysteptestdrivethatFromGartnerpressrelease:http:wwwgartnercomitpagejspid=FromtheGartnerpressrelease:http:wwwgartnercomitpagejspid=CHAPTER:AndroidFundamentalsinvolvesgeneratingabarebonesAndroidprojectandgettingtheresultingskeletonAndroidapplicationupandrunningintheAndroidemulatorThenextorderofbusinesswillbeatouroftheAndroidplatformarchitectureHerewewilldescribetheAndroidplatformstackAndroidcomponentarchitectureandDalvik,theAndroidruntimeWiththisknowledgeinhand,wethencoverworkingwiththeJavaIDEsEclipse,NetBeans,andIntelliJIDEACommunityEditionplusspendsometimelearninghowtoequipthemwithAndroidprogrammingcapabilitiesviapluginsThismeanswehavealotofgroundtocover,solet'sgetstartedWhatIsAndroidInanutshell,AndroidisanoperatingsystemtargetedatmobilehardwaresuchasphonesandotherconstrainedcomputingdevicessuchasnetbooksandtabletcomputersTheconceptandplatformwasthebrainchildofAndroidInc,asmallstartupcompanyfromPaloAlto,California,thatwasacquiredbyGoogleinItsstatedgoalwastocreateasmall,stable,flexible,andeasilyupgradedoperatingsystemforhandsetsthatwouldbehighlyattractivefordevicemanufacturersandtelephonycarriersAndroidplatformreleasesxthroughxareaimedprimarilyatsmartphonedevices,whereasitisreportedthatAndroidreleasexwillbethefirstoperatingplatformspecificallydesignedwithhighendsupportfortabletcomputersTheAndroidplatformwasoriginallyunveiledinNovemberTheunveilingcoincidedwiththeannouncementoftheformationoftheOpenHandsetAlliance,agroupofcompaniesthatsharethegoalofpromotingopenstandardsformobiledeviceplatformssuchasAndroidInOctober,AndroidwasreleasedundertheApacheopensourcelicenseThisandtheflexiblecomponentbaseddesignoftheplatformpresentinnovativeandcosteffectiveopportunitiesformanufacturersandsoftwaredevelopersalikeWeaimtoshowcasesomeofthesedistinguishingplatformcapabilitiesduringthecourseofthisbookInstallingtheAndroidSDKWewillstartbyinstallingthecoreAndroidSDKandtoolsOuraimistogettheAndroidemulatorwithourownsimpleapplicationupandrunningonanAndroidVirtualDevice(AVD)assoonaspossibleTheexperiencegainedwillthenserveasabasisforfurtherdiscussionhttp:sourceandroidcomsourcelicenseshtmlCHAPTER:AndroidFundamentalsTheexamplesandcommandsyouwillbeshownwererunonamixtureofUbuntuGNULinux,MicrosoftWindows,andAppleMacOSXsystemsAllthetools,includingtheJDKandtheAndroidSDKtoolset,behaveinasimilar,ifnotidentical,manneracrossthemajorsupportedcomputingplatformsJavaDevelopmentKit(JDK)Tobeginwith,youshouldhavearecentversionoftheJavaSDK(JDK)installedonyourparticularsystemItcanbeobtainedeitherfromyouroperatingsystemdistributionpackageinstallmanagerapplicationordirectlydownloadedfromtheInternetWeassumethatwedonotneedtogointothedetailsfordoingthisSufficeittosaythatJDKorupwardshouldbefineThiswritingisbasedonJDKCHECKINGTHEJDKVERSION:ToconfirmthatacompatibleversionoftheJDKisinstalledandavailabletotheenvironment,weusuallydoaquickcheckonthecommandlineorconsoleterminal,asfollows:$java–versionjavaversion""OpenJDKRuntimeEnvironment(IcedTea)(bubuntu)OpenJDKServerVM(buildb,mixedmode)$javac–versionjavacIfsomethinggoeswrong,youshouldconsulttheJDKconfigurationdocumentationforyourparticularplatformWewillnotcoverdebuggingJavainstallationshereAndroidSDKandTargetPlatformsAssumingthatourJavaplatformisready,wenowneedtodownloadtheAndroidSDKstarterpackageanduseittoinstallourtargetAndroidplatformsTheAndroidSDKstarterpackagecanbedownloadedfromtheofficialGoogleAndroidSDKdownloadsiteSelectthedownloadappropriateforyourdevelopmentplatformThesupportedplatformscurrentlyincludeWindows,MacOSX(Intel),andLinux(i)InthecaseofhavingdownloadedanSDKstarterpackagearchiveforLinuxorMacOSX,unpackthedownloadedarchiveintoadirectoryofyourchoicehttps:jdkdevjavanethttp:developerandroidcomsdkCHAPTER:AndroidFundamentalsInthecaseofhavingdownloadedtheWindowsinstaller(exefile),runtheinstallerandinstallintoadirectoryofyourchoiceYoucouldcallthisdirectoryanythingyoulike,butwerecommendsomethingsimilartothefollowing:LinuxorMacOSXsystem:~androidsdklinuxxWindowssystem:C:androidsdkwindowsMakeanoteofthisdirectorypathnameforlateruseWithintherootoftheunpackeddirectorystructurethereshouldbeatextfilewithanamelikeSDKReadmetxtThishasspecificinstructionsforeachplatformWhatisimportanttonotehereisthatthedownloadedarchivedoesnotincludethecompleteSDKThefollowingnotecontainsanextractfromthereadmeshippedwiththelatestAndroidSDKasofthiswritingREADTHESDKREADME!TheAndroidSDKarchiveonlycontainsthetoolsItnolongercomespopulatedwithaspecificAndroidplatformorGoogleaddonInstead,youusetheSDKManagertoinstallorupdateSDKcomponentssuchasplatforms,tools,addons,anddocumentationInordertostartdevelopingapplications,youmustinstallatleastoneversionoftheAndroidplatformusingtheSDKManagerThisrequiresanInternetconnection,soifyouplantousetheSDKoffline,pleasemakesuretodownloadthenecessarycomponentswhileonlineAtthispoint,itisrecommendedtoaddtheAndroidSDKtoolsdirectorytothedevelopmentenvironmentsystemPATHvariableThetoolsdirectorycanbefoundundertheprecedingunpackedrootdirectory:<sdk>toolsHavingthebinariesandtoolsonthepathwillmakeitalotmoreconvenienttoissueAndroidSDKcommandsfromanywhereontheterminalconsoleofyourdevelopmentsystemAsanexample,afteraddingtheappropriateentriestotheshelluserloginscriptformyGNULinuxdevelopmentsystem,wereceivethefollowingoutputfromlistingitwiththeLinuxcatcommand:$cat~bashrc#googleandroiddevtoolsexportPATH="$PATH:~androidsdklinuxtools"exportPATH="$PATH:~androidsdklinuxplatformtools"AndroidSDKrelease,AndroidplatformCHAPTER:AndroidFundamentalsSETTINGTHEPATHONWINDOWS:Fromthedesktop,rightclickMyComputerandclickPropertiesAlternatively,fromControlPanel,doubleclickSystemBothoptionsopentheSystemPropertiesdialogboxNowclicktheAdvancedtabIntheAdvancedsection,clicktheEnvironmentVariablesbuttonIntheEnvironmentVariableswindow,selectthePATHvariableintheUserorSystemVariablesection,dependingonwhetheryouwantthesettingappliedforallusersorjustyourselfClicktheEditbuttonAddormodifythepathDirectoriesareseparatedbyasemicolonClickOKwhendoneForconfirmation,issuingthefollowingcommandonyourdevelopmentsystemwillprintthecurrentvalueofthesystemPATHvariabletotheterminalconsolewindowLinuxandMacOSX:echo$PATHWindows:echoPATHAndroidPlatformAPILevelsTheAPIleveltargetedbyyourapplicationisveryimportantforreasonsofdevicecompatibilityandthesoftwaredevelopmentandmaintenancelifetimeofyourcodebaseIfitisnotmanagedproperly,themaintenanceofyourapplicationcouldpotentiallybecomeanightmare,especiallyifitisdeployedtomultipleAndroiddevicesandoperatingplatformsItisalsoagoodideatobecomefamiliarwiththefolderstructuresoftheAndroidSDKonceitisinstalledAgain,thisisespeciallyvalidifyourapplicationswillbebuiltformultipleAndroidhardwaretargetsForabetterunderstandingofthesubjectofAPIlevels,itiswellworththeeffortofreviewingthedocumentationfoundontheofficialdeveloper’swebsiteforAndroidAPIlevelsThetieinbetweenAPIlevelnumbersandtheircorrespondingplatformsareclarifiedinTable–,whichwascurrentatthetimeofwritinghttp:developerandroidcomguideappendixapilevelshtmlCHAPTER:AndroidFundamentalsTable–AndroidPlatformVersionsandAPILevelsPlatformVersionAPILevelAndroidAndroidAndroidAndroidAndroidAndroidAndroidAndroidAndroidAndroidPlatformSetupHereisashortlistofdependenciesforproceedingwiththesetupofSDKplatforms:AndroidSDKstarterpackagedownloadedandunpackedTheJDK,ADK,andAnttoolsareaccessibleontheenvironmentpathWehaveabasicunderstandingofAndroidplatformversionsandAPIlevelsLastbutnotleast,weshouldbeconnectedtotheInternetWecannowinstalltheSDKplatformcomponentsusingtheAndroidSDKandAVDManagerprogramsTostarttheSDKManageronLinuxorMacOSX,executethefollowingcommand:$androidTostarttheSDKManageronWindows,runthefollowingprogram:SDKManagerexeThemainuserinterfaceoftheAndroidSDKManageronLinuxshouldappearasinFigure–CHAPTER:AndroidFundamentalsFigure–TheAndroidSDKandAVDManagerduringinitialSDKsetuponLinuxWINDOWSUSBDRIVERFORANDROIDDEVICES:ItisworthshowingtheequivalentAndroidSDKandAVDManagerfortheWindowsplatform(seeFigure–)Itcontainsanimportantaddition,theWindowsUSBDriverpackageforAndroiddevicesThiswillbecomenecessarywhenyoudevelop,debug,anddeploydirectlyinconjunctionwithaphysicalAndroidphoneorotherAndroidhardwaredeviceattachedviaUSBcabletoaWindowscomputerCHAPTER:AndroidFundamentalsFigure–TheAndroidSDKandAVDManagerduringinitialSDKsetuponWindowsNotethatinbothcaseswehaveselectedtheAndroidplatform,APIlevel,plustherelevantadditionssuchasdocumentationandSDKsamplesNowclickInstallSelectedTheappropriateSDKresourcebundleswillnowbedownloadedandinstalledintotheSDKdirectorystructurewhereweunpackedtheSDKstarterarchiveInordertomaintainandupdateyourSDKovertime,anupdatesessioncanbedirectlyinitiatedfromthecommandlinebyexecutingthefollowingcommands:InaterminalsessiononLinuxMacOSX:$androidupdatesdkBesidestheoptionofsimplyrunningSDKManagerexeagain,thesamecanbeachievedfromtheWindowscommandpromptwiththefollowing:C:>androidbatupdatesdkCHAPTER:AndroidFundamentalsAgain,weassumethattheAndroidtoolscanbefoundonthesystempathFurtherinformationaboutmanagingyourAndroidSDKinstallationcanbefoundontheAndroidDevelopers“AddingSDKComponents”pageExtraTools:ApacheAntTherearesomedevelopmenttoolsthatnoJavadevelopershoulddowithoutOnesuchanindispensableutilityisApacheAnt,whichisabuildtoolthatisJava'sroughequivalenttomakemakeistraditionallyusedinCCdevelopmentenvironmentsAntalsodiffersfrommakeinthatitusesXMLtospecifybuildstepsandactionsTheAndroidSDKextensivelyusesAntforitscompilation,build,anddeploymentinfrastructureWewilluseittotestdriveourcoretoolsinthenextsectionSoifitisnotalreadyinstalledonyoursystem,werecommendyougrabacopyandinstallitIfnecessary,youcanfindinstallationinstructionsandmoreinformationaboutAntontheofficialAntwebsiteSOMEIDESALREADYCONTAINANT:IfyouwillbeusinganIDEexclusively,installingastandaloneinstanceofApacheAntmightnotbenecessaryIDEssuchasEclipseandNetBeanscomepackagedwithanAntdistributionthattheyinvokebehindthescenesduringthebuildprocessIfyouareplanningtoworkthroughtheexamplesthatfollow,ensurethatAntisonthesystemenvironmentpathonceitisinstalledAndroidSDKTestDriveWewillnowtakeourSDKandplatforminstallationforacomprehensivetestdrivetocompletetheinstallationofruntimecomponentsandtoconfirmthateverythingwassetupcorrectlyWewillalsogettoknowtheenvironmentbetterThisisacentralpartofthischapterandwillformthebasisoffurthersubjectscoveredInitially,wewilldotheworkfromtheterminalconsole,commandline,orcommandprompt,whicheverterminologyisappropriateforyoursystemorpersonalpreferenceCreateanapplicationprojectdirectorytoworkinandcallitHelloAndroidSdkFromwithinaparentorhomedirectoryofyourchoicesomewhereonyoursystem,issuethefollowingcommands:OnLinuxorMacOSX:$mkdirHelloAndroidSdk$cdHelloAndroidSdkhttp:developerandroidcomsdkaddingcomponentshtmlhttp:antapacheorgDownloadfromWow!eBook<wwwwowebook

类似资料

该用户的其他资料

数据结构题解.pdf

MFC程序员的WTL指南.pdf

Visual C 界面编程技术.pdf

[android.开发书籍].Android.in.Action.2.pdf

[android.开发书籍].Android.User.Interface.Development.Beginners.Guide.Feb.2011.pdf

职业精品

精彩专题

上传我的资料

精选资料

热门资料排行换一换

  • 军事技术图解辞典.pdf

  • 日知录导读.pdf

  • 世界禁书文库+猫的摇篮.pdf

  • 世界禁书文库+春梦之结.pdf

  • 尼各马可伦理学(英文版).pdf

  • She Comes First …

  • 蒙古述略——蒙古史.pdf

  • 屈原研究+褚斌杰编.pdf

  • 《玄奘西游记》(典藏本)钱文忠着…

  • 资料评价:

    / 418
    所需积分:0 立即下载

    意见
    反馈

    返回
    顶部