爱问 爱问共享资料 爱问分类
首页 > > > Android-Application-Development-For-Dummies.pdf

Android-Application-Development-For-Dummies.pdf

Android-Application-Development…

上传者: sweetbaybe
7次下载 0人收藏 暂无简介 简介 2011-06-27 举报

简介:android 应用程序开发资料

DonnFelkerIndependentsoftwaredevelopmentconsultantLearnto:•CreateappsforhotsmartphoneslikeDroidX,GalaxyS,andMyTouch•DownloadtheSDKandgetEclipseupandrunning•CodeAndroidapplications•SubmityourappstotheAndroidMarketAndroidApplicationDevelopmentMakingEverythingEasier!VisitthecompanionWebsiteatwww.dummies.com/go/androidappdevfdforsourcecode,updates,andotherexamplestohelpyouinthedevelopmentprocessOpenthebookandfind:•Coolwaystousetheaccelerometerinyourapp•Howtoturnmobilelimitationsintoopportunities•Tipsoninstallingandsettingupthetools•Step-by-stepcodingdirections•Waystomakeyourappsmoremarketable•Howtocreatereallyusefulmenus•Adviceonapppricing•TengreatsampleappsandSDKs,includingcodeDonnFelkerisanindependentconsultantspecializinginAndroidand.NETtechnologies.Hehasbeenatechnicalarchitect,softwaredeveloper,andprogrammeranalystformorethanadecade,withexperiencethatcoversdesktop,Web,andmobiledevelopment.$29.99US/$35.99CN/21.99UKISBN978-0-470-77018-4ProgrammingLanguages/JavaGotoDummies.comforvideos,step-by-stepexamples,how-toarticles,ortoshop!Here’sjustwhatyouneedtostartdevelopingfeature-rich,amazingAndroidappsEvenifyou’veneverwrittenamobileapplication,thisbookhastheknow-howyouneedtoturnyourgreatideasintocoolappsfortheAndroidplatform.Withmillionsofsmartphoneusersandacornucopiaofcarriers,Androidisagreatplacetoplytheappdevelopmenttrade.Thisbookshowsyoufromthegrounduphowtosetupyourenvironmentandcreateanapp.ReadontobecomeanAndroiddeveloperextraordinaire!•WelcometoAndroid—learnwhatmakesagreatAndroidapp,howtousetheSDK,waystoworkwithmobilescreens,andhowthedevelopmentprocessworks•Makeusershappy—findouthowtodesignaninterfacethatmobileuserswilllove•Learnthecode—workwiththeactivitylifecycleandAndroidframeworkclasses,usetheEclipsedebugger,andcreateahomescreenwidgetforyourapp•Beyondthebasics—takeyourskillsupanotchwithappsthatinvolveSQLitedatabasesandmultiplescreens•Priceandpublish—picktherightpriceforyourappandgetitintotheAndroidMarketAndroidApplicationDevelopmentFelkerStartwithFREECheatSheetsCheatSheetsinclude•Checklists•Charts•CommonInstructions•AndOtherGoodStuff!GetSmartatDummies.comDummies.commakesyourlifeeasierwith1,000sofanswersoneverythingfromremovingwallpapertousingthelatestversionofWindows.Checkoutour•Videos•IllustratedArticles•Step-by-StepInstructionsPlus,eachmonthyoucanwinvaluableprizesbyenteringourDummies.comsweepstakes.*WantaweeklydoseofDummies?SignupforNewsletterson•DigitalPhotography•MicrosoftWindows&Office•PersonalFinance&Investing•Health&Wellness•Computing,iPods&CellPhones•eBay•Internet•Food,Home&GardenFindout“HOW”atDummies.com*Sweepstakesnotcurrentlyavailableinallcountries;visitDummies.comforofficialrules.GetMoreandDoMoreatDummies.comToaccesstheCheatSheetcreatedspecificallyforthisbook,gotowww.dummies.com/cheatsheet/androidapplicationdevelopmentMobileAppsThere’saDummiesAppforThisandThatWithmorethan200millionbooksinprintandover1,600uniquetitles,Dummiesisagloballeaderinhow-toinformation.NowyoucangetthesamegreatDummiesinformationinanApp.WithtopicssuchasWine,Spanish,DigitalPhotography,Certification,andmore,you’llhaveinstantaccesstothetopicsyouneedtoknowinaformatyoucantrust.TogetinformationonallourDummiesapps,visitthefollowing:www.Dummies.com/go/mobilefromyourcomputer.www.Dummies.com/go/iphone/appsfromyourphone.AndroidApplicationDevelopmentFORDUMmIES‰01_9780470770184-ffirs.inddi01_9780470770184-ffirs.inddi11/2/108:45AM11/2/108:45AM01_9780470770184-ffirs.inddii01_9780470770184-ffirs.inddii11/2/108:45AM11/2/108:45AMbyDonnFelkerwithJoshuaDobbsAndroidApplicationDevelopmentFORDUMmIES‰01_9780470770184-ffirs.inddiii01_9780470770184-ffirs.inddiii11/2/108:45AM11/2/108:45AMAndroidTMApplicationDevelopmentForDummiesPublishedbyWileyPublishing,Inc.111RiverStreetHoboken,NJ07030-5774www.wiley.comCopyright2011byWileyPublishing,Inc.,Indianapolis,IndianaPublishedbyWileyPublishing,Inc.,Indianapolis,IndianaPublishedsimultaneouslyinCanadaNopartofthispublicationmaybereproduced,storedinaretrievalsystemortransmittedinanyformorbyanymeans,electronic,mechanical,photocopying,recording,scanningorotherwise,exceptaspermit-tedunderSections107or108ofthe1976UnitedStatesCopyrightAct,withouteitherthepriorwrittenpermissionofthePublisher,orauthorizationthroughpaymentoftheappropriateper-copyfeetotheCopyrightClearanceCenter,222RosewoodDrive,Danvers,MA01923,(978)750-8400,fax(978)646-8600.RequeststothePublisherforpermissionshouldbeaddressedtothePermissionsDepartment,JohnWiley&Sons,Inc.,111RiverStreet,Hoboken,NJ07030,(201)748-6011,fax(201)748-6008,oronlineathttp://www.wiley.com/go/permissions.Trademarks:Wiley,theWileyPublishinglogo,ForDummies,theDummiesManlogo,AReferencefortheRestofUs!,TheDummiesWay,DummiesDaily,TheFunandEasyWay,Dummies.com,MakingEverythingEasier,andrelatedtradedressaretrademarksorregisteredtrademarksofJohnWiley&Sons,Inc.and/oritsaffiliatesintheUnitedStatesandothercountries,andmaynotbeusedwithoutwrittenpermission.AndroidisatrademarkofGoogle,Inc.Allothertrademarksarethepropertyoftheirrespectiveowners.WileyPublishing,Inc.,isnotassociatedwithanyproductorvendormentionedinthisbook.LIMITOFLIABILITY/DISCLAIMEROFWARRANTY:THEPUBLISHERANDTHEAUTHORMAKENOREPRESENTATIONSORWARRANTIESWITHRESPECTTOTHEACCURACYORCOMPLETENESSOFTHECONTENTSOFTHISWORKANDSPECIFICALLYDISCLAIMALLWARRANTIES,INCLUDINGWITH-OUTLIMITATIONWARRANTIESOFFITNESSFORAPARTICULARPURPOSE.NOWARRANTYMAYBECREATEDOREXTENDEDBYSALESORPROMOTIONALMATERIALS.THEADVICEANDSTRATEGIESCONTAINEDHEREINMAYNOTBESUITABLEFOREVERYSITUATION.THISWORKISSOLDWITHTHEUNDERSTANDINGTHATTHEPUBLISHERISNOTENGAGEDINRENDERINGLEGAL,ACCOUNTING,OROTHERPROFESSIONALSERVICES.IFPROFESSIONALASSISTANCEISREQUIRED,THESERVICESOFACOMPETENTPROFESSIONALPERSONSHOULDBESOUGHT.NEITHERTHEPUBLISHERNORTHEAUTHORSHALLBELIABLEFORDAMAGESARISINGHEREFROM.THEFACTTHATANORGANIZA-TIONORWEBSITEISREFERREDTOINTHISWORKASACITATIONAND/ORAPOTENTIALSOURCEOFFURTHERINFORMATIONDOESNOTMEANTHATTHEAUTHORORTHEPUBLISHERENDORSESTHEINFORMATIONTHEORGANIZATIONORWEBSITEMAYPROVIDEORRECOMMENDATIONSITMAYMAKE.FURTHER,READERSSHOULDBEAWARETHATINTERNETWEBSITESLISTEDINTHISWORKMAYHAVECHANGEDORDISAPPEAREDBETWEENWHENTHISWORKWASWRITTENANDWHENITISREAD.Forgeneralinformationonourotherproductsandservices,pleasecontactourCustomerCareDepartmentwithintheU.S.at877-762-2974,outsidetheU.S.at317-572-3993,orfax317-572-4002.Fortechnicalsupport,pleasevisitwww.wiley.com/techsupport.Wileyalsopublishesitsbooksinavarietyofelectronicformats.Somecontentthatappearsinprintmaynotbeavailableinelectronicbooks.LibraryofCongressControlNumber:2010939962ISBN:978-0-470-77018-4ManufacturedintheUnitedStatesofAmerica1098765432101_9780470770184-ffirs.inddiv01_9780470770184-ffirs.inddiv11/2/108:45AM11/2/108:45AMAbouttheAuthorsDonnFelkerisarecognizedleaderinthedevelopmentandconsultationofstate-of-the-art,cutting-edgesoftwareinthemobileandWebfields.Heisanindependentconsultantwithover10yearsofprofessionalexperienceinvariousmarketsthatincludeentertainment,health,retail,insurance,finan-cial,andrealestate.Heisamobilejunkie,serialentrepreneur,andcreativeinnovatorinallthingsmobileandWeb.HeisthefounderofAgilevent,aninnovativecreativedevelopmentfirmthathasdoneworkforsmallstartupsaswellasFortune500companies.HeisaMicrosoftASPInsider,anMCTSfor.NETFramework2.0and3.5WebApplications,andacertifiedScrumMaster.He’sanationalspeakerontopicsthatincludeAndroid,.NET,andsoftwarearchitecture.HeistheauthoroftheTekPub.comIntroductiontoAndroidvideoseries.Heisawriter,presenter,andconsultantonvarioustopicsrang-ingfromarchitecturetodevelopmentingeneral,agilepractices,andpatternsandpractices.FollowDonnonTwitter(@donnfelker)orreadhisbloghere:http://blog.donnfelker.com.JoshuaDobbsisaseniorleadWebapplicationdeveloperforalargeelec-tronicsmanufacturerinSouthernCalifornia.Hehasmorethantenyears’experienceinWebanddesktopapplicationdevelopment.JoshwasanearlyadopteroftheAndroidplatformandcreatesAndroidappsinhissparetime.Hisappshavebeendownloadedmorethan6milliontimes,andhewasselectedbyGoogleastopAndroiddeveloperforitsDeviceSeedingProgram.HisWebsiteiswww.joshdobbs.com.01_9780470770184-ffirs.inddv01_9780470770184-ffirs.inddv11/2/108:45AM11/2/108:45AM01_9780470770184-ffirs.inddvi01_9780470770184-ffirs.inddvi11/2/108:45AM11/2/108:45AMDedicationTomydogs,LuluandMacho,andmycat,Vito:ThanksforkeepingmecompanyinthecoldbasementwhileIcrankedoutpageafterpageintheweehoursofthemorningwhileeveryoneelsewasasleep.Writingisalonelygig,andyourcompanyhelpedthetimepassmucheasier(andkeptmyfeetandlapwarmtoo).Tomydearestdaughter,Sophia,whomadeeventhetoughestdaysbrighterthroughhercontagious,infectiouslaughterandantics.Iloveyou.Mostofall,tomygorgeouswife,Ginamarie,whohasalwaysbeenverysup-portiveofallmycrazy,harebrainedideasovertheyears.IwouldnothavegottenwhereIaminmylifeifitwerenotforyoursupport.Iloveyou.01_9780470770184-ffirs.inddvii01_9780470770184-ffirs.inddvii11/2/108:45AM11/2/108:45AM01_9780470770184-ffirs.inddviii01_9780470770184-ffirs.inddviii11/2/108:45AM11/2/108:45AMAuthor’sAcknowledgmentsThankstocoauthorJoshuaDobbsforwritingthecoupleofchaptersthatIneededhelpwith.Maywebothhavemanymoresuccessfulbooksinthefuture!ThankstoWileyAcquisitionsEditorKyleLooperforgivingmeashotatwrit-ingthisbook.Ireallyappreciatethehelp,support,andinsightintoeverythingpublishing-related.You’vebeenalifesaveronthisproject.Thankyou.ProjectEditorKathySimpsonpushedmebeyondwhatIthoughtwouldbepossibleintermsoftheorganizationofthecontentandreadability.Thankyouforbeingadiligenteditor.CopyEditorJohnEdwardshelpedfindsomeofmymostsubtlemistakes,whichallowedmetopolishthebookcontentevenmore.Thankyou.TechnicalEditorAndreTaddeiniisoneofthefewtechnicalindividualsItrustwholeheartedly.I’mgladyouweremysecondpairofeyesonthisproject.Yoursanitycheckofthetechnicalaccuracyofthebookwasoutstanding.Thankyou.Finally,thankyoutomyfriendJohnBendaforcontributingbybeingsupportiveofmeandmyfamilyduringthisprocess.It’sbeenalongroad.Nowit’syourturntowriteabook!01_9780470770184-ffirs.inddix01_9780470770184-ffirs.inddix11/2/108:45AM11/2/108:45AMPublisher’sAcknowledgmentsWe’reproudofthisbook;pleasesendusyourcommentsathttp://dummies.custhelp.com.Forothercomments,pleasecontactourCustomerCareDepartmentwithintheU.S.at877-762-2974,outsidetheU.S.at317-572-3993,orfax317-572-4002.Someofthepeoplewhohelpedbringthisbooktomarketincludethefollowing:AcquisitionsandEditorialProjectEditor:KathySimpsonAcquisitionsEditor:KyleLooperCopyEditor:JohnEdwardsTechnicalEditor:AndreTaddeiniEditorialManager:JodiJensenEditorialAssistant:AmandaGrahamSr.EditorialAssistant:CherieCaseCartoons:RichTennant(www.the5thwave.com)CompositionServicesProjectCoordinator:ShereeMontgomeryLayoutandGraphics:NikkiGately,LauraWesthuisProofreaders:LauraBowman,RebeccaDenoncourIndexer:BIMIndexing&ProofreadingServicesPublishingandEditorialforTechnologyDummiesRichardSwadley,VicePresidentandExecutiveGroupPublisherAndyCummings,VicePresidentandPublisherMaryBednarek,ExecutiveAcquisitionsDirectorMaryC.Corder,EditorialDirectorPublishingforConsumerDummiesDianeGravesSteele,VicePresidentandPublisherCompositionServicesGerryFahey,VicePresidentofProductionServicesDebbieStailey,DirectorofCompositionServices01_9780470770184-ffirs.inddx01_9780470770184-ffirs.inddx11/2/108:45AM11/2/108:45AMContentsataGlanceIntroduction................................................................1PartI:TheNutsandBoltsofAndroid............................7Chapter1:DevelopingSpectacularAndroidApplications...........................................9Chapter2:PreppingYourDevelopmentHeadquarters..............................................25PartII:BuildingandPublishingYourFirstAndroidApplication....................................53Chapter3:YourFirstAndroidProject..........................................................................55Chapter4:DesigningtheUserInterface.......................................................................93Chapter5:CodingYourApplication...........................................................................117Chapter6:UnderstandingAndroidResources..........................................................155Chapter7:TurningYourApplicationintoaHome-ScreenWidget..........................163Chapter8:PublishingYourApptotheAndroidMarket..........................................187PartIII:CreatingaFeature-RichApplication............209Chapter9:DesigningtheTaskReminderApplication..............................................211Chapter10:GoingalaCartewithYourMenu............................................................231Chapter11:HandlingUserInput..................................................................................241Chapter12:GettingPersistentwithDataStorage.....................................................261Chapter13:RemindingtheUserwithAlarmManager...............................................291Chapter14:UpdatingtheAndroidStatusBar............................................................303Chapter15:WorkingwithAndroid’sPreferenceFramework..................................313PartIV:ThePartofTens..........................................329Chapter16:TenGreatFreeSampleApplicationsandSDKs(WithCode!).............331Chapter17:TenToolsThatMakeYourDevelopingLifeEasier..............................337Index......................................................................34102_9780470770184-ftoc.inddxi02_9780470770184-ftoc.inddxi11/2/108:46AM11/2/108:46AM02_9780470770184-ftoc.inddxii02_9780470770184-ftoc.inddxii11/2/108:46AM11/2/108:46AMTableofContentsIntroduction.................................................................1AboutThisBook..............................................................................................1ConventionsUsedinThisBook.....................................................................2FoolishAssumptions.......................................................................................3HowThisBookIsOrganized..........................................................................3PartI:TheNutsandBoltsofAndroid.................................................3PartII:BuildingandPublishingYourFirstAndroidApplication.....4PartIII:CreatingaFeature-RichApplication......................................4PartIV:ThePartofTens.......................................................................4IconsUsedinThisBook.................................................................................4WheretoGofromHere...................................................................................5PartI:TheNutsandBoltsofAndroid............................7Chapter1:DevelopingSpectacularAndroidApplications..........9WhyDevelopforAndroid?.............................................................................9Marketshare.........................................................................................10Timetomarket.....................................................................................10Openplatform......................................................................................10Cross-compatibility.............................................................................11Mashupcapability...............................................................................11AndroidProgrammingBasics......................................................................13Java:YourAndroidprogramminglanguage.....................................13Activities...............................................................................................14Intents....................................................................................................14Cursorlesscontrols.............................................................................15Viewsandwidgets...............................................................................16Asynchronouscalls.............................................................................16Backgroundservices...........................................................................17HardwareTools.............................................................................................18Touchscreen.........................................................................................19GPS.........................................................................................................19Accelerometer......................................................................................20SDCard..................................................................................................20SoftwareTools...............................................................................................20Internet..................................................................................................21Audioandvideosupport....................................................................21Contacts................................................................................................21Security.................................................................................................22GoogleAPIs...........................................................................................2202_9780470770184-ftoc.inddxiii02_9780470770184-ftoc.inddxiii11/2/108:46AM11/2/108:46AMAndroidApplicationDevelopmentForDummiesxivChapter2:PreppingYourDevelopmentHeadquarters.....

Android-Application-Development-For-Dummies.pdf

Android-Application-Development…

上传者: sweetbaybe
7次下载 0人收藏 暂无简介 简介 2011-06-27 举报

简介:android 应用程序开发资料

DonnFelkerIndependentsoftwaredevelopmentconsultantLearnto:•CreateappsforhotsmartphoneslikeDroidX,GalaxyS,andMyTouch•DownloadtheSDKandgetEclipseupandrunning•CodeAndroidapplications•SubmityourappstotheAndroidMarketAndroidApplicationDevelopmentMakingEverythingEasier!VisitthecompanionWebsiteatwww.dummies.com/go/androidappdevfdforsourcecode,updates,andotherexamplestohelpyouinthedevelopmentprocessOpenthebookandfind:•Coolwaystousetheaccelerometerinyourapp•Howtoturnmobilelimitationsintoopportunities•Tipsoninstallingandsettingupthetools•Step-by-stepcodingdirections•Waystomakeyourappsmoremarketable•Howtocreatereallyusefulmenus•Adviceonapppricing•TengreatsampleappsandSDKs,includingcodeDonnFelkerisanindependentconsultantspecializinginAndroidand.NETtechnologies.Hehasbeenatechnicalarchitect,softwaredeveloper,andprogrammeranalystformorethanadecade,withexperiencethatcoversdesktop,Web,andmobiledevelopment.$29.99US/$35.99CN/21.99UKISBN978-0-470-77018-4ProgrammingLanguages/JavaGotoDummies.comforvideos,step-by-stepexamples,how-toarticles,ortoshop!Here’sjustwhatyouneedtostartdevelopingfeature-rich,amazingAndroidappsEvenifyou’veneverwrittenamobileapplication,thisbookhastheknow-howyouneedtoturnyourgreatideasintocoolappsfortheAndroidplatform.Withmillionsofsmartphoneusersandacornucopiaofcarriers,Androidisagreatplacetoplytheappdevelopmenttrade.Thisbookshowsyoufromthegrounduphowtosetupyourenvironmentandcreateanapp.ReadontobecomeanAndroiddeveloperextraordinaire!•WelcometoAndroid—learnwhatmakesagreatAndroidapp,howtousetheSDK,waystoworkwithmobilescreens,andhowthedevelopmentprocessworks•Makeusershappy—findouthowtodesignaninterfacethatmobileuserswilllove•Learnthecode—workwiththeactivitylifecycleandAndroidframeworkclasses,usetheEclipsedebugger,andcreateahomescreenwidgetforyourapp•Beyondthebasics—takeyourskillsupanotchwithappsthatinvolveSQLitedatabasesandmultiplescreens•Priceandpublish—picktherightpriceforyourappandgetitintotheAndroidMarketAndroidApplicationDevelopmentFelkerStartwithFREECheatSheetsCheatSheetsinclude•Checklists•Charts•CommonInstructions•AndOtherGoodStuff!GetSmartatDummies.comDummies.commakesyourlifeeasierwith1,000sofanswersoneverythingfromremovingwallpapertousingthelatestversionofWindows.Checkoutour•Videos•IllustratedArticles•Step-by-StepInstructionsPlus,eachmonthyoucanwinvaluableprizesbyenteringourDummies.comsweepstakes.*WantaweeklydoseofDummies?SignupforNewsletterson•DigitalPhotography•MicrosoftWindows&Office•PersonalFinance&Investing•Health&Wellness•Computing,iPods&CellPhones•eBay•Internet•Food,Home&GardenFindout“HOW”atDummies.com*Sweepstakesnotcurrentlyavailableinallcountries;visitDummies.comforofficialrules.GetMoreandDoMoreatDummies.comToaccesstheCheatSheetcreatedspecificallyforthisbook,gotowww.dummies.com/cheatsheet/androidapplicationdevelopmentMobileAppsThere’saDummiesAppforThisandThatWithmorethan200millionbooksinprintandover1,600uniquetitles,Dummiesisagloballeaderinhow-toinformation.NowyoucangetthesamegreatDummiesinformationinanApp.WithtopicssuchasWine,Spanish,DigitalPhotography,Certification,andmore,you’llhaveinstantaccesstothetopicsyouneedtoknowinaformatyoucantrust.TogetinformationonallourDummiesapps,visitthefollowing:www.Dummies.com/go/mobilefromyourcomputer.www.Dummies.com/go/iphone/appsfromyourphone.AndroidApplicationDevelopmentFORDUMmIES‰01_9780470770184-ffirs.inddi01_9780470770184-ffirs.inddi11/2/108:45AM11/2/108:45AM01_9780470770184-ffirs.inddii01_9780470770184-ffirs.inddii11/2/108:45AM11/2/108:45AMbyDonnFelkerwithJoshuaDobbsAndroidApplicationDevelopmentFORDUMmIES‰01_9780470770184-ffirs.inddiii01_9780470770184-ffirs.inddiii11/2/108:45AM11/2/108:45AMAndroidTMApplicationDevelopmentForDummiesPublishedbyWileyPublishing,Inc.111RiverStreetHoboken,NJ07030-5774www.wiley.comCopyright2011byWileyPublishing,Inc.,Indianapolis,IndianaPublishedbyWileyPublishing,Inc.,Indianapolis,IndianaPublishedsimultaneouslyinCanadaNopartofthispublicationmaybereproduced,storedinaretrievalsystemortransmittedinanyformorbyanymeans,electronic,mechanical,photocopying,recording,scanningorotherwise,exceptaspermit-tedunderSections107or108ofthe1976UnitedStatesCopyrightAct,withouteitherthepriorwrittenpermissionofthePublisher,orauthorizationthroughpaymentoftheappropriateper-copyfeetotheCopyrightClearanceCenter,222RosewoodDrive,Danvers,MA01923,(978)750-8400,fax(978)646-8600.RequeststothePublisherforpermissionshouldbeaddressedtothePermissionsDepartment,JohnWiley&Sons,Inc.,111RiverStreet,Hoboken,NJ07030,(201)748-6011,fax(201)748-6008,oronlineathttp://www.wiley.com/go/permissions.Trademarks:Wiley,theWileyPublishinglogo,ForDummies,theDummiesManlogo,AReferencefortheRestofUs!,TheDummiesWay,DummiesDaily,TheFunandEasyWay,Dummies.com,MakingEverythingEasier,andrelatedtradedressaretrademarksorregisteredtrademarksofJohnWiley&Sons,Inc.and/oritsaffiliatesintheUnitedStatesandothercountries,andmaynotbeusedwithoutwrittenpermission.AndroidisatrademarkofGoogle,Inc.Allothertrademarksarethepropertyoftheirrespectiveowners.WileyPublishing,Inc.,isnotassociatedwithanyproductorvendormentionedinthisbook.LIMITOFLIABILITY/DISCLAIMEROFWARRANTY:THEPUBLISHERANDTHEAUTHORMAKENOREPRESENTATIONSORWARRANTIESWITHRESPECTTOTHEACCURACYORCOMPLETENESSOFTHECONTENTSOFTHISWORKANDSPECIFICALLYDISCLAIMALLWARRANTIES,INCLUDINGWITH-OUTLIMITATIONWARRANTIESOFFITNESSFORAPARTICULARPURPOSE.NOWARRANTYMAYBECREATEDOREXTENDEDBYSALESORPROMOTIONALMATERIALS.THEADVICEANDSTRATEGIESCONTAINEDHEREINMAYNOTBESUITABLEFOREVERYSITUATION.THISWORKISSOLDWITHTHEUNDERSTANDINGTHATTHEPUBLISHERISNOTENGAGEDINRENDERINGLEGAL,ACCOUNTING,OROTHERPROFESSIONALSERVICES.IFPROFESSIONALASSISTANCEISREQUIRED,THESERVICESOFACOMPETENTPROFESSIONALPERSONSHOULDBESOUGHT.NEITHERTHEPUBLISHERNORTHEAUTHORSHALLBELIABLEFORDAMAGESARISINGHEREFROM.THEFACTTHATANORGANIZA-TIONORWEBSITEISREFERREDTOINTHISWORKASACITATIONAND/ORAPOTENTIALSOURCEOFFURTHERINFORMATIONDOESNOTMEANTHATTHEAUTHORORTHEPUBLISHERENDORSESTHEINFORMATIONTHEORGANIZATIONORWEBSITEMAYPROVIDEORRECOMMENDATIONSITMAYMAKE.FURTHER,READERSSHOULDBEAWARETHATINTERNETWEBSITESLISTEDINTHISWORKMAYHAVECHANGEDORDISAPPEAREDBETWEENWHENTHISWORKWASWRITTENANDWHENITISREAD.Forgeneralinformationonourotherproductsandservices,pleasecontactourCustomerCareDepartmentwithintheU.S.at877-762-2974,outsidetheU.S.at317-572-3993,orfax317-572-4002.Fortechnicalsupport,pleasevisitwww.wiley.com/techsupport.Wileyalsopublishesitsbooksinavarietyofelectronicformats.Somecontentthatappearsinprintmaynotbeavailableinelectronicbooks.LibraryofCongressControlNumber:2010939962ISBN:978-0-470-77018-4ManufacturedintheUnitedStatesofAmerica1098765432101_9780470770184-ffirs.inddiv01_9780470770184-ffirs.inddiv11/2/108:45AM11/2/108:45AMAbouttheAuthorsDonnFelkerisarecognizedleaderinthedevelopmentandconsultationofstate-of-the-art,cutting-edgesoftwareinthemobileandWebfields.Heisanindependentconsultantwithover10yearsofprofessionalexperienceinvariousmarketsthatincludeentertainment,health,retail,insurance,finan-cial,andrealestate.Heisamobilejunkie,serialentrepreneur,andcreativeinnovatorinallthingsmobileandWeb.HeisthefounderofAgilevent,aninnovativecreativedevelopmentfirmthathasdoneworkforsmallstartupsaswellasFortune500companies.HeisaMicrosoftASPInsider,anMCTSfor.NETFramework2.0and3.5WebApplications,andacertifiedScrumMaster.He’sanationalspeakerontopicsthatincludeAndroid,.NET,andsoftwarearchitecture.HeistheauthoroftheTekPub.comIntroductiontoAndroidvideoseries.Heisawriter,presenter,andconsultantonvarioustopicsrang-ingfromarchitecturetodevelopmentingeneral,agilepractices,andpatternsandpractices.FollowDonnonTwitter(@donnfelker)orreadhisbloghere:http://blog.donnfelker.com.JoshuaDobbsisaseniorleadWebapplicationdeveloperforalargeelec-tronicsmanufacturerinSouthernCalifornia.Hehasmorethantenyears’experienceinWebanddesktopapplicationdevelopment.JoshwasanearlyadopteroftheAndroidplatformandcreatesAndroidappsinhissparetime.Hisappshavebeendownloadedmorethan6milliontimes,andhewasselectedbyGoogleastopAndroiddeveloperforitsDeviceSeedingProgram.HisWebsiteiswww.joshdobbs.com.01_9780470770184-ffirs.inddv01_9780470770184-ffirs.inddv11/2/108:45AM11/2/108:45AM01_9780470770184-ffirs.inddvi01_9780470770184-ffirs.inddvi11/2/108:45AM11/2/108:45AMDedicationTomydogs,LuluandMacho,andmycat,Vito:ThanksforkeepingmecompanyinthecoldbasementwhileIcrankedoutpageafterpageintheweehoursofthemorningwhileeveryoneelsewasasleep.Writingisalonelygig,andyourcompanyhelpedthetimepassmucheasier(andkeptmyfeetandlapwarmtoo).Tomydearestdaughter,Sophia,whomadeeventhetoughestdaysbrighterthroughhercontagious,infectiouslaughterandantics.Iloveyou.Mostofall,tomygorgeouswife,Ginamarie,whohasalwaysbeenverysup-portiveofallmycrazy,harebrainedideasovertheyears.IwouldnothavegottenwhereIaminmylifeifitwerenotforyoursupport.Iloveyou.01_9780470770184-ffirs.inddvii01_9780470770184-ffirs.inddvii11/2/108:45AM11/2/108:45AM01_9780470770184-ffirs.inddviii01_9780470770184-ffirs.inddviii11/2/108:45AM11/2/108:45AMAuthor’sAcknowledgmentsThankstocoauthorJoshuaDobbsforwritingthecoupleofchaptersthatIneededhelpwith.Maywebothhavemanymoresuccessfulbooksinthefuture!ThankstoWileyAcquisitionsEditorKyleLooperforgivingmeashotatwrit-ingthisbook.Ireallyappreciatethehelp,support,andinsightintoeverythingpublishing-related.You’vebeenalifesaveronthisproject.Thankyou.ProjectEditorKathySimpsonpushedmebeyondwhatIthoughtwouldbepossibleintermsoftheorganizationofthecontentandreadability.Thankyouforbeingadiligenteditor.CopyEditorJohnEdwardshelpedfindsomeofmymostsubtlemistakes,whichallowedmetopolishthebookcontentevenmore.Thankyou.TechnicalEditorAndreTaddeiniisoneofthefewtechnicalindividualsItrustwholeheartedly.I’mgladyouweremysecondpairofeyesonthisproject.Yoursanitycheckofthetechnicalaccuracyofthebookwasoutstanding.Thankyou.Finally,thankyoutomyfriendJohnBendaforcontributingbybeingsupportiveofmeandmyfamilyduringthisprocess.It’sbeenalongroad.Nowit’syourturntowriteabook!01_9780470770184-ffirs.inddix01_9780470770184-ffirs.inddix11/2/108:45AM11/2/108:45AMPublisher’sAcknowledgmentsWe’reproudofthisbook;pleasesendusyourcommentsathttp://dummies.custhelp.com.Forothercomments,pleasecontactourCustomerCareDepartmentwithintheU.S.at877-762-2974,outsidetheU.S.at317-572-3993,orfax317-572-4002.Someofthepeoplewhohelpedbringthisbooktomarketincludethefollowing:AcquisitionsandEditorialProjectEditor:KathySimpsonAcquisitionsEditor:KyleLooperCopyEditor:JohnEdwardsTechnicalEditor:AndreTaddeiniEditorialManager:JodiJensenEditorialAssistant:AmandaGrahamSr.EditorialAssistant:CherieCaseCartoons:RichTennant(www.the5thwave.com)CompositionServicesProjectCoordinator:ShereeMontgomeryLayoutandGraphics:NikkiGately,LauraWesthuisProofreaders:LauraBowman,RebeccaDenoncourIndexer:BIMIndexing&ProofreadingServicesPublishingandEditorialforTechnologyDummiesRichardSwadley,VicePresidentandExecutiveGroupPublisherAndyCummings,VicePresidentandPublisherMaryBednarek,ExecutiveAcquisitionsDirectorMaryC.Corder,EditorialDirectorPublishingforConsumerDummiesDianeGravesSteele,VicePresidentandPublisherCompositionServicesGerryFahey,VicePresidentofProductionServicesDebbieStailey,DirectorofCompositionServices01_9780470770184-ffirs.inddx01_9780470770184-ffirs.inddx11/2/108:45AM11/2/108:45AMContentsataGlanceIntroduction................................................................1PartI:TheNutsandBoltsofAndroid............................7Chapter1:DevelopingSpectacularAndroidApplications...........................................9Chapter2:PreppingYourDevelopmentHeadquarters..............................................25PartII:BuildingandPublishingYourFirstAndroidApplication....................................53Chapter3:YourFirstAndroidProject..........................................................................55Chapter4:DesigningtheUserInterface.......................................................................93Chapter5:CodingYourApplication...........................................................................117Chapter6:UnderstandingAndroidResources..........................................................155Chapter7:TurningYourApplicationintoaHome-ScreenWidget..........................163Chapter8:PublishingYourApptotheAndroidMarket..........................................187PartIII:CreatingaFeature-RichApplication............209Chapter9:DesigningtheTaskReminderApplication..............................................211Chapter10:GoingalaCartewithYourMenu............................................................231Chapter11:HandlingUserInput..................................................................................241Chapter12:GettingPersistentwithDataStorage.....................................................261Chapter13:RemindingtheUserwithAlarmManager...............................................291Chapter14:UpdatingtheAndroidStatusBar............................................................303Chapter15:WorkingwithAndroid’sPreferenceFramework..................................313PartIV:ThePartofTens..........................................329Chapter16:TenGreatFreeSampleApplicationsandSDKs(WithCode!).............331Chapter17:TenToolsThatMakeYourDevelopingLifeEasier..............................337Index......................................................................34102_9780470770184-ftoc.inddxi02_9780470770184-ftoc.inddxi11/2/108:46AM11/2/108:46AM02_9780470770184-ftoc.inddxii02_9780470770184-ftoc.inddxii11/2/108:46AM11/2/108:46AMTableofContentsIntroduction.................................................................1AboutThisBook..............................................................................................1ConventionsUsedinThisBook.....................................................................2FoolishAssumptions.......................................................................................3HowThisBookIsOrganized..........................................................................3PartI:TheNutsandBoltsofAndroid.................................................3PartII:BuildingandPublishingYourFirstAndroidApplication.....4PartIII:CreatingaFeature-RichApplication......................................4PartIV:ThePartofTens.......................................................................4IconsUsedinThisBook.................................................................................4WheretoGofromHere...................................................................................5PartI:TheNutsandBoltsofAndroid............................7Chapter1:DevelopingSpectacularAndroidApplications..........9WhyDevelopforAndroid?.............................................................................9Marketshare.........................................................................................10Timetomarket.....................................................................................10Openplatform......................................................................................10Cross-compatibility.............................................................................11Mashupcapability...............................................................................11AndroidProgrammingBasics......................................................................13Java:YourAndroidprogramminglanguage.....................................13Activities...............................................................................................14Intents....................................................................................................14Cursorlesscontrols.............................................................................15Viewsandwidgets...............................................................................16Asynchronouscalls.............................................................................16Backgroundservices...........................................................................17HardwareTools.............................................................................................18Touchscreen.........................................................................................19GPS.........................................................................................................19Accelerometer......................................................................................20SDCard..................................................................................................20SoftwareTools...............................................................................................20Internet..................................................................................................21Audioandvideosupport....................................................................21Contacts................................................................................................21Security.................................................................................................22GoogleAPIs...........................................................................................2202_9780470770184-ftoc.inddxiii02_9780470770184-ftoc.inddxiii11/2/108:46AM11/2/108:46AMAndroidApplicationDevelopmentForDummiesxivChapter2:PreppingYourDevelopmentHeadquarters.....
  • 相关资料
  • 该用户的其他资料
  • 名称/格式
  • 下载次数
  • 资料大小
  • 名称/格式
  • 下载次数
  • 资料大小

用户评论

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

请选择举报的类型

关闭

提示

提交成功!

感谢您对爱问共享资料的支持,我们将尽快核实并处理您的举报信息。

关闭

提示

提交失败!

您的举报信息提交失败,请重试!

关闭

提示

重复举报!

亲爱的用户!感觉您对爱问共享资料的支持,请勿重复举报噢!

全屏 缩小 放大
收藏
资料评价:

/ 388
所需积分:2 立即下载
返回
顶部
举报
资料
关闭

温馨提示

感谢您对爱问共享资料的支持,精彩活动将尽快为您呈现,敬请期待!