关闭

关闭

封号提示

内容

首页 Programming Android.pdf

Programming Android.pdf

Programming Android.pdf

上传者: 陆永 2011-10-13 评分 5 0 225 31 1023 暂无简介 简介 举报

简介:本文档为《Programming Androidpdf》,可适用于IT/计算机领域,主题内容包含ProgrammingAndroidProgrammingAndroidZigurdMednieks,LairdDornin,GBlakeMeike符等。

ProgrammingAndroidProgrammingAndroidZigurdMednieks,LairdDornin,GBlakeMeike,andMasumiNakamuraBeijing•Cambridge•Farnham•Köln•Sebastopol•TokyoProgrammingAndroidbyZigurdMednieks,LairdDornin,GBlakeMeike,andMasumiNakamuraCopyrightZigurdMednieks,LairdDornin,GBlakeMeike,andMasumiNakamuraAllrightsreservedPrintedintheUnitedStatesofAmericaPublishedbyO’ReillyMedia,Inc,GravensteinHighwayNorth,Sebastopol,CAO’Reillybooksmaybepurchasedforeducational,business,orsalespromotionaluseOnlineeditionsarealsoavailableformosttitles(http:mysafaribooksonlinecom)Formoreinformation,contactourcorporateinstitutionalsalesdepartment:()orcorporateoreillycomEditors:AndyOramandBrianJepsonProductionEditor:AdamZarembaCopyeditor:AudreyDoyleTechnicalEditors:VijaySYellapragadaandJohanvanderHoevenProofreader:SadaPreischIndexer:LucieHaskinsCoverDesigner:KarenMontgomeryInteriorDesigner:DavidFutatoIllustrator:RebeccaDemarestPrintingHistory:July:FirstEditionNutshellHandbook,theNutshellHandbooklogo,andtheO’ReillylogoareregisteredtrademarksofO’ReillyMedia,IncProgrammingAndroid,theimageofapinegrosbeak,andrelatedtradedressaretrademarksofO’ReillyMedia,IncManyofthedesignationsusedbymanufacturersandsellerstodistinguishtheirproductsareclaimedastrademarksWherethosedesignationsappearinthisbook,andO’ReillyMedia,Inc,wasawareofatrademarkclaim,thedesignationshavebeenprintedincapsorinitialcapsWhileeveryprecautionhasbeentakeninthepreparationofthisbook,thepublisherandauthorsassumenoresponsibilityforerrorsoromissions,orfordamagesresultingfromtheuseoftheinformationcontainedhereinISBN:LSITableofContentsPrefacexiiiPartIToolsandBasicsYourToolkitInstallingtheAndroidSDKandPrerequisitesTheJavaDevelopmentKit(JDK)TheEclipseIntegratedDevelopmentEnvironment(IDE)TheAndroidSDKAddingBuildTargetstotheSDKTheAndroidDevelopmentToolkit(ADT)PluginforEclipseTestDrive:ConfirmThatYourInstallationWorksMakinganAndroidProjectMakinganAndroidVirtualDevice(AVD)RunningaProgramonanAVDRunningaProgramonanAndroidDeviceTroubleshootingSDKProblems:NoBuildTargetsComponentsoftheSDKTheAndroidDebugBridge(adb)TheDalvikDebugMonitorServer(DDMS)ComponentsoftheADTEclipsePluginAndroidVirtualDevicesOtherSDKToolsKeepingUptoDateKeepingtheAndroidSDKUptoDateKeepingEclipseandtheADTPluginUptoDateKeepingtheJDKUptoDateExampleCodeSDKExampleCodeExampleCodefromThisBookOnReadingCodevJavaforAndroidAndroidIsReshapingClientSideJavaTheJavaTypeSystemPrimitiveTypesObjectsandClassesObjectCreationTheObjectClassandItsMethodsObjects,Inheritance,andPolymorphismFinalandStaticDeclarationsAbstractClassesInterfacesExceptionsTheJavaCollectionsFrameworkGarbageCollectionScopeJavaPackagesAccessModifiersandEncapsulationIdiomsofJavaProgrammingTypeSafetyinJavaUsingAnonymousClassesModularProgramminginJavaBasicMultithreadedConcurrentProgramminginJavaSynchronizationandThreadSafetyThreadControlwithwait()andnotify()MethodsSynchronizationandDataStructuresTheIngredientsofanAndroidApplicationTraditionalProgrammingModelsComparedtoAndroidActivities,Intents,andTasksOtherAndroidComponentsServiceContentProvidersBroadcastReceiverStaticApplicationResourcesandContextApplicationManifestsATypicalSourceTreeInitializationParametersinAndroidManifestxmlResourcesTheAndroidApplicationRuntimeEnvironmentTheDalvikVMZygote:ForkingaNewProcessSandboxing:ProcessesandUsersComponentLifeCyclesvi|TableofContentsTheActivityLifeCyclePackaginganAndroidApplication:TheapkFileOnPortingSoftwaretoAndroidGettingYourApplicationintoUsers’HandsApplicationSigningPublicKeyEncryptionandCryptographicSigningHowSignaturesProtectSoftwareUsers,Publishers,andSecureCommunicationsSigninganApplicationPlacinganApplicationforDistributionintheAndroidMarketBecominganOfficialAndroidDeveloperUploadingApplicationsintheMarketGettingPaidGoogleMapsAPIKeysSpecifyingAPILevelCompatibilityCompatibilitywithManyKindsofScreensTestingforScreenSizeCompatibilityResourceQualifiersandScreenSizesEclipseforAndroidSoftwareDevelopmentEclipseConceptsandTerminologyPluginsWorkspacesJavaEnvironmentsProjectsBuildersandArtifactsExtensionsAssociationsEclipseViewsandPerspectivesThePackageExplorerViewTheTaskListViewTheOutlineViewTheProblemsViewJavaCodinginEclipseEditingJavaCodeandCodeCompletionRefactoringEclipseandAndroidPreventingBugsandKeepingYourCodeCleanStaticAnalyzersApplyingStaticAnalysistoAndroidCodeLimitationsofStaticAnalysisEclipseIdiosyncrasiesandAlternativesTableofContents|viiEffectiveJavaforAndroidTheAndroidFrameworkTheAndroidLibrariesExtendingAndroidOrganizingJavaSourceConcurrencyinAndroidAsyncTaskandtheUIThreadThreadsinanAndroidProcessSerializationJavaSerializationParcelableClassesThatSupportSerializationSerializationandtheApplicationLifeCyclePartIIAbouttheAndroidFrameworkBuildingaViewAndroidGUIArchitectureTheModelTheViewTheControllerPuttingItTogetherAssemblingaGraphicalInterfaceWiringUptheControllerListeningtotheModelListeningforTouchEventsListeningforKeyEventsAlternativeWaystoHandleEventsAdvancedWiring:FocusandThreadingTheMenuFragmentsandMultiplatformSupportCreatingaFragmentFragmentLifeCycleTheFragmentManagerFragmentTransactionsTheCompatibilityPackageDrawingDandDGraphicsRollingYourOwnWidgetsLayoutCanvasDrawingviii|TableofContentsDrawablesBitmapsBlingShadows,Gradients,andFiltersAnimationOpenGLGraphicsHandlingandPersistingDataRelationalDatabaseOverviewSQLiteTheSQLLanguageSQLDataDefinitionCommandsSQLDataManipulationCommandsAdditionalDatabaseConceptsDatabaseTransactionsExampleDatabaseManipulationUsingsqliteSQLandtheDatabaseCentricDataModelforAndroidApplicationsTheAndroidDatabaseClassesDatabaseDesignforAndroidApplicationsBasicStructureoftheSimpleVideoDbHelperClassUsingtheDatabaseAPI:MJAndroidAndroidandSocialNetworkingTheSourceFolder(src)LoadingandStartingtheApplicationDatabaseQueriesandReadingDatafromtheDatabaseModifyingtheDatabasePartIIIASkeletonApplicationforAndroidAFrameworkforaWellBehavedApplicationVisualizingLifeCyclesVisualizingtheActivityLifeCycleVisualizingtheFragmentLifeCycleTheActivityClassandWellBehavedApplicationsTheActivityLifeCycleandtheUserExperienceLifeCycleMethodsoftheApplicationClassAFlowingandIntuitiveUserExperienceAcrossActivitiesMultitaskinginaSmallScreenEnvironmentTasksandApplicationsSpecifyingLaunchandTaskBehaviorTableofContents|ixUsingContentProvidersUnderstandingContentProvidersImplementingaContentProviderBrowsingVideowithFinchDefiningaProviderPublicAPIDefiningtheCONTENTURICreatingtheColumnNamesDeclaringColumnSpecificationStringsWritingandIntegratingaContentProviderCommonContentProviderTasksFileManagementandBinaryDataAndroidMVCandContentObservationACompleteContentProvider:TheSimpleFinchVideoContentProviderCodeTheSimpleFinchVideoContentProviderClassandInstanceVariablesImplementingtheonCreateMethodImplementingthegetTypeMethodImplementingtheProviderAPIDeterminingHowOftentoNotifyObserversDeclaringYourContentProviderExploringContentProvidersDevelopingRESTfulAndroidApplicationsA“NetworkMVC”SummaryofBenefitsCodeExample:DynamicallyListingandCachingYouTubeVideoContentStructureoftheSourceCodefortheFinchYouTubeVideoExampleSteppingThroughtheSearchApplicationStep:OurUICollectsUserInputStep:OurControllerListensforEventsStep:TheControllerQueriestheContentProviderwithamanagedQueryontheContentProviderModelStep:ImplementingtheRESTfulRequestConstantsandInitializationCreatingtheDatabaseANetworkedQueryMethodinsertandResponseHandlersFileManagement:StoringThumbnailsx|TableofContentsPartIVAdvancedTopicsMultimediaAudioandVideoPlayingAudioandVideoAudioPlaybackVideoPlaybackRecordingAudioandVideoAudioRecordingVideoRecordingStoredMediaContentLocationandMappingLocationBasedServicesMappingTheGoogleMapsActivityTheMapViewandMapActivityWorkingwithMapViewsMapViewandMyLocationOverlayInitializationPausingandResumingaMapActivityControllingtheMapwithMenuButtonsControllingtheMapwiththeKeypadLocationWithoutMapsTheManifestandLayoutFilesConnectingtoaLocationProviderandGettingLocationUpdatesUpdatingtheEmulatedLocationSensors,NFC,Speech,Gestures,andAccessibilitySensorsPositionOtherSensorsNearFieldCommunication(NFC)ReadingaTagWritingtoaTagPPModeGestureInputAccessibilityCommunication,Identity,Sync,andSocialMediaAccountContactsAuthenticationandSynchronizationAuthenticationTableofContents|xiSynchronizationBluetoothTheBluetoothProtocolStackBluez:TheLinuxBluetoothImplementationUsingBluetoothinAndroidApplicationsTheAndroidNativeDevelopmentKit(NDK)NativeMethodsandJNICallsConventionsontheNativeMethodSideConventionsontheJavaSideTheAndroidNDKSettingUptheNDKEnvironmentCompilingwiththeNDKJNI,NDK,andSDK:ASampleAppAndroidProvidedNativeLibrariesBuildingYourOwnCustomLibraryModulesNativeActivitiesIndexxii|TableofContentsPrefaceThepurposeofthisbookistoenableyoutocreatewellengineeredAndroidapplicationsthatgobeyondthescopeofsmallexampleapplicationsThisbookisforpeoplecomingtoAndroidprogrammingfromavarietyofbackgroundsIfyouhavebeenprogrammingiPhoneorMacOSapplicationsinObjectiveC,youwillfindcoverageofAndroidtoolsandJavalanguagefeaturesrelevanttoAndroidprogrammingthatwillhelpyoubringyourknowledgeofmobileapplicationdevelopmenttoAndroidIfyouareanexperiencedJavacoder,youwillfindcoverageofAndroidapplicationarchitecturethatwillenableyoutouseyourJavaexpertiseinthisnewlyvibrantworldofclientJavaapplicationdevelopmentInshort,thisisabookforpeoplewithsomerelevantexperienceinobjectorientedlanguages,mobileapplications,RESTapplications,andsimilardisciplineswhowanttogofurtherthananintroductorybookoronlinetutorialswilltakethemHowThisBookIsOrganizedWewanttogetyouofftoafaststartThechaptersinthefirstpartofthisbookwillstepyouthroughusingtheSDKtoolssothatyoucanaccessexamplecodeinthisbookandintheSDK,evenasyouexpandyourknowledgeofSDKtools,Java,anddatabasedesignThetoolsandbasicscoveredinthefirstpartmightbefamiliarenoughtoyouthatyouwouldwanttoskiptoPartIIwherewebuildfoundationalknowledgefordevelopinglargerAndroidapplicationsThecentralpartofthisbookisanexampleofanapplicationthatuseswebservicestodeliverinformationtotheusersomethingmanyapplicationshaveattheircoreWepresentanapplicationarchitecture,andanovelapproachtousingAndroid’sframeworkclassesthatenablesyoutodothisparticularlyefficientlyYouwillbeabletousethisapplicationasaframeworkforcreatingyourownapplications,andasatoolforlearningaboutAndroidprogrammingInthefinalpartofthisbook,weexploreAndroidAPIsinspecificapplicationareas:multimedia,location,sensors,andcommunication,amongothers,inordertoequipyoutoprogramapplicationsinyourspecificareaofinterestxiiiBythetimeyoureachtheendofthisbook,wewantyoutohavegainedknowledgebeyondreferencematerialandawalkthroughofexamplesWewantyoutohaveapointofviewonhowtomakegreatAndroidapplicationsConventionsUsedinThisBookThefollowingtypographicalconventionsareusedinthisbook:ItalicIndicatesnewterms,URLs,emailaddresses,filenames,andfileextensionsConstantwidthUsedforprogramlistings,aswellaswithinparagraphstorefertoprogramelementssuchasvariableorfunctionnames,databases,datatypes,environmentvariables,statements,andkeywordsConstantwidthboldShowscommandsorothertextthatshouldbetypedliterallybytheuserConstantwidthitalicShowstextthatshouldbereplacedwithusersuppliedvaluesorbyvaluesdeterminedbycontextThisiconsignifiesatip,suggestion,orgeneralnoteThisiconindicatesawarningorcautionUsingCodeExamplesThisbookisheretohelpyougetyourjobdoneIngeneral,youmayusethecodeinthisbookinyourprogramsanddocumentationYoudonotneedtocontactusforpermissionunlessyou’rereproducingasignificantportionofthecodeForexample,writingaprogramthatusesseveralchunksofcodefromthisbookdoesnotrequirepermissionSellingordistributingaCDROMofexamplesfromO’ReillybooksdoesrequirepermissionAnsweringaquestionbycitingthisbookandquotingexamplecodedoesnotrequirepermissionIncorporatingasignificantamountofexamplecodefromthisbookintoyourproduct’sdocumentationdoesrequirepermissionWeappreciate,butdonotrequire,attributionAnattributionusuallyincludesthetitle,author,publisher,andISBNForexample:“ProgrammingAndroidbyZigurdxiv|PrefaceMednieks,LairdDornin,GBlakeMeike,andMasumiNakamuraCopyrightO’ReillyMedia,Inc,”Ifyoufeelyouruseofcodeexamplesfallsoutsidefairuseorthepermissiongivenhere,feelfreetocontactusatpermissionsoreillycomSafariBooksOnlineSafariBooksOnlineisanondemanddigitallibrarythatletsyoueasilysearchmorethan,technologyandcreativereferencebooksandvideostofindtheanswersyouneedquicklyWithasubscription,youcanreadanypageandwatchanyvideofromourlibraryonlineReadbooksonyourcellphoneandmobiledevicesAccessnewtitlesbeforetheyareavailableforprint,andgetexclusiveaccesstomanuscriptsindevelopmentandpostfeedbackfortheauthorsCopyandpastecodesamples,organizeyourfavorites,downloadchapters,bookmarkkeysections,createnotes,printoutpages,andbenefitfromtonsofothertimesavingfeaturesO’ReillyMediahasuploadedthisbooktotheSafariBooksOnlineserviceTohavefulldigitalaccesstothisbookandothersonsimilartopicsfromO’Reillyandotherpublishers,signupforfreeathttp:mysafaribooksonlinecomHowtoContactUsPleaseaddresscommentsandquestionsconcerningthisbooktothepublisher:O’ReillyMedia,IncGravensteinHighwayNorthSebastopol,CA(intheUnitedStatesorCanada)(internationalorlocal)(fax)Wehaveawebpageforthisbook,wherewelisterrata,examples,andanyadditionalinformationYoucanaccessthispageat:http:oreillycomcatalogTocommentorasktechnicalquestionsaboutthisbook,sendemailto:bookquestionsoreillycomFormoreinformationaboutourbooks,courses,conferences,andnews,seeourwebsiteathttp:wwworeillycomFindusonFacebook:http:facebookcomoreillyFollowusonTwitter:http:twittercomoreillymediaPreface|xvWatchusonYouTube:http:wwwyoutubecomoreillymediaAcknowledgmentsTheauthorshaveadaptedportionsofthisbookfromtheirpreviouslyreleasedtitle,AndroidApplicationDevelopment(O’Reilly)DraftsofthisbookwerereleasedontheO’ReillyOpenFeedbackPublishingSystem(OFPS)inordertogetyourfeedbackonwhetherandhowwearemeetingthegoalsforthisbookWeareverygratefulforthereaderswhoparticipatedinOFPS,andweowethemmuchincorrectingourerrorsandimprovingourwritingOpenreviewofdraftswillbepartoffutureeditions,andwewelcomeyourviewsoneveryaspectofthisbookxvi|PrefacePARTIToolsandBasicsPartIshowsyouhowtoinstallanduseyourtools,whatyouneedtoknowaboutJavatowritegoodAndroidcode,andhowtodesignanduseSQLdatabases,whicharecentraltotheAndroidapplicationmodel,persistencesystem,andimplementationofkeydesignpatternsinAndroidprogramsCHAPTERYourToolkitThischaptershowsyouhowtoinstalltheAndroidsoftwaredevelopmentkit(SDK)andall

类似资料

编辑推荐

人教版高中化学必修2说课稿全套.doc

1与食品经营相适应的操作流程.doc

国际金融新编(第四版)姜波克.pdf

四念住讲记-妙境老和尚.doc

跨文化沟通个案研究丛书+吴宓:理想的使者.pdf

职业精品

精彩专题

上传我的资料

精选资料

热门资料排行换一换

  • 八斤鞋.pdf

  • 技术人员绩效考核表.doc

  • 仇海情泪【美】罗宾斯(江苏文艺出…

  • 中医拔罐疗法.pdf

  • 【针灸经穴学】杨维杰.pdf

  • 针灸经穴图考.黄竹斋.pdf

  • 【拔罐疗法】(植兰英).pdf

  • 护患有效的沟通在工作中的重要性.…

  • 宏观经济学.英文版.pdf

  • 资料评价:

    / 502
    所需积分:1 立即下载

    意见
    反馈

    返回
    顶部