关闭

关闭

封号提示

内容

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

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

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

上传者: appleflashstudio 2011-03-24 评分1 评论0 下载638 收藏0 阅读量1523 暂无简介 简介 举报

简介:本文档为《[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

人力资源管理(英文版).ppt

人力资源管理的历史及发展.doc

人力资源管理试题.doc

用户评论

0/200
    暂无评论
上传我的资料

精彩专题

相关资料换一换

资料评价:

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

意见
反馈

返回
顶部