关闭

关闭

关闭

封号提示

内容

首页 Android User Interface Development - Beginners …

Android User Interface Development - Beginners Guide.pdf

Android User Interface Developm…

上传者: xuanguang 2013-11-03 评分 0 0 0 0 0 0 暂无简介 简介 举报

简介:本文档为《Android User Interface Development - Beginners Guidepdf》,可适用于IT/计算机领域,主题内容包含AndroidUserInterfaceDevelopmentBeginner'sGuideQuicklydesignanddevelopcompe符等。

AndroidUserInterfaceDevelopmentBeginner'sGuideQuicklydesignanddevelopcompellinguserinterfacesforyourAndroidapplicationsJasonMorrisBIRMINGHAMMUMBAIDownloadfromWow!eBook<wwwwowebookcom>AndroidUserInterfaceDevelopmentBeginner'sGuideCopyrightPacktPublishingAllrightsreservedNopartofthisbookmaybereproduced,storedinaretrievalsystem,ortransmittedinanyformorbyanymeans,withoutthepriorwrittenpermissionofthepublisher,exceptinthecaseofbriefquotationsembeddedincriticalarticlesorreviewsEveryefforthasbeenmadeinthepreparationofthisbooktoensuretheaccuracyoftheinformationpresentedHowever,theinformationcontainedinthisbookissoldwithoutwarranty,eitherexpressorimpliedNeithertheauthornorPacktPublishing,anditsdealersanddistributorswillbeheldliableforanydamagescausedorallegedtobecauseddirectlyorindirectlybythisbookPacktPublishinghasendeavoredtoprovidetrademarkinformationaboutallofthecompaniesandproductsmentionedinthisbookbytheappropriateuseofcapitalsHowever,PacktPublishingcannotguaranteetheaccuracyofthisinformationFirstpublished:FebruaryProductionReference:PublishedbyPacktPublishingLtdLincolnRoadOltonBirmingham,BPA,UKISBNwwwpacktpubcomCoverImagebyCharwakA(charwakgmailcom)CreditsAuthorJasonMorrisReviewersDavidJGroomMartinSkansAcquisitionEditorChaitanyaApteDevelopmentEditorReshmaSundaresanTechnicalEditorHarshitShahCopyEditorNehaShettyIndexerTejalDaruwaleEditorialTeamLeaderAksharaAwareProjectTeamLeaderPriyaMukherjiProjectCoordinatorShubhanjanChatterjeeProofreaderJoelTJohnsonGraphicsNileshRMohiteProductionCoordinatorsKruthikaBangeraAparnaBhagatCoverWorkKruthikaBangeraAbouttheAuthorJasonMorrishasworkedonsoftwareasdiverseasfruittrackingsystems,insurancesystems,andtravelsearchandbookingenginesHehasbeenwritingsoftwareforaslongashecanrememberHeiscurrentlyworkingasaSoftwareArchitectforTravelstartinSouthAfricaHeworksonmultiplefrontendandmiddlewaresystems,leveragingavarietyofJavabasedtechnologiesThepeopleI'dliketothankmostfortheirdirect,orindirecthelpinwritingthisbookaremywifeCaronMorris,myfatherMikeMorris,mymomJayneMorris,andtherestofmyfamilyfortheirloveandsupportI'dalsoliketothankWayne,Stuart,Angela,andJames,andeveryoneonmyteamatTravelstartFinallyaverybigthankstoMartinSkansforhisinvaluableinputAbouttheReviewerMartinSkansgraduatedfromLundUniversityinSweden,withaMaster'sdegreeinComputerScienceAfteracoupleofyearsintheonlinemarketingindustry,hemovedontobecomeadeveloperforTravelstart,anonlinetravelagencyHerelocatedtoCapeTownandiscurrentlyworkingonTravelstart'sAfricantravelplatformwhichhasbeenrecentlylaunchedforthemobilemarketwwwPacktPubcomSupportfiles,eBooks,discountoffersandmoreYoumightwanttovisitwwwPacktPubcomforsupportfilesanddownloadsrelatedtoyourbookDidyouknowthatPacktofferseBookversionsofeverybookpublished,withPDFandePubfilesavailableYoucanupgradetotheeBookversionatwwwPacktPubcomandasaprintbookcustomer,youareentitledtoadiscountontheeBookcopyGetintouchwithusatservicepacktpubcomformoredetailsAtwwwPacktPubcom,youcanalsoreadacollectionoffreetechnicalarticles,signupforarangeoffreenewslettersandreceiveexclusivediscountsandoffersonPacktbooksandeBookshttp:PacktLibPacktPubcomDoyouneedinstantsolutionstoyourITquestionsPacktLibisPackt'sonlinedigitalbooklibraryHere,youcanaccess,readandsearchacrossPackt'sentirelibraryofbooksWhySubscribe‹FullysearchableacrosseverybookpublishedbyPackt‹Copyandpaste,printandbookmarkcontent‹OndemandandaccessibleviawebbrowserFreeAccessforPacktaccountholdersIfyouhaveanaccountwithPacktatwwwPacktPubcom,youcanusethistoaccessPacktLibtodayandviewnineentirelyfreebooksSimplyuseyourlogincredentialsforimmediateaccessTableofContentsPrefaceChapter:DevelopingaSimpleActivityDevelopingourfirstexampleCreatingtheprojectstructureTimeforaction–settinguptheAndroidSDKTimeforaction–startinganewprojectExaminingtheAndroidprojectlayoutTimeforaction–runningtheexampleprojectThescreenlayoutThelayoutXMLfileResourceselectionqualifiersTimeforaction–settingupthequestionactivityPopulatingaViewandaViewGroupTimeforaction–askingaquestionTimeforaction–addingaspaceforanswersTimeforaction–addingmorebuttonsDefiningcommondimensionsLimitationsofthelayoutXMLformatPopulatingtheQuestionActivityTimeforaction–writingmoreJavacodeDynamicallycreatingwidgetsTimeforaction–puttingthequestionsonthescreenHandlingeventsinAndroidSummaryChapter:PresentingDataforViewsListingandselectingdataListViewchoicemodesNoselectionmode–CHOICEMODENONESingleselectionmode–CHOICEMODESINGLEMultipleselectionmode–CHOICEMODEMULTIPLETableofContentsiiAddingheaderandfooterwidgetsCreatingasimpleListViewTimeforaction–creatingafastfoodmenuStylingthestandardListAdaptersDefiningstandarddimensionsTimeforaction–improvingtherestaurantlistCreatingcustomadaptersCreatingamenuforTheBurgerPlaceTimeforaction–creatingaBurgeritemlayoutTimeforaction–presentingBurgerobjectsCreatingTheBurgerPlaceActivityclassTimeforaction–implementingTheBurgerPlaceActivityRegisteringandstartingTheBurgerPlaceActivityUsingtheExpandableListViewclassCreatingExpandableListAdapterimplementationsUsingtheGridViewclassTimeforaction–creatingthefruiticonDisplayingiconsinaGridViewTimeforaction–buildingthefruitmenuTimeforaction–creatingtheFourBucketsActivitySummaryChapter:DevelopingwithSpecializedAndroidWidgetsCreatingarestaurantreviewapplicationTimeforaction–creatingtheroboticreviewprojectstructureBuildingaTabActivityCreatingtabiconsAndroidtabsandiconsImplementingtheReviewActivityTimeforaction–writingtheReviewActivityclassTimeforaction–creatingtheReviewlayoutWorkingwithswitcherclassesTimeforaction–turningontheTextSwitcherCreatingasimplephotogalleryTimeforaction–buildingthePhotostabCreatingathumbnailwidgetImplementingaGalleryAdapterTimeforaction–theGalleryAdapterTimeforaction–makingthegalleryworkBuildingthereservationtabTimeforaction–implementingthereservationlayoutTimeforaction–initializingthereservationtabTableofContentsiiiTimeforaction–listeningtotheSeekBarTimeforaction–selectingdateandtimeCreatingcomplexlayoutswithInclude,Merge,andViewStubsUsingIncludetagsMerginglayoutsUsingtheViewStubclassSummaryChapter:LeveragingActivitiesandIntentsExploringtheActivityclassUsingBundleobjectsTimeforaction–buildinganexamplegame:"guessmynumber"CreatingandconsumingintentsDefiningIntentactionsPassingdatainanIntentAddingextradatatoanIntentUsingadvancedIntentfeaturesGettingdatabackfromanIntentTimeforaction–viewingphonebookcontactsSummaryChapter:DevelopingNonlinearLayoutsTimeforaction–creatingalayoutsexampleprojectFrameLayoutCommonusesTimeforaction–developingaFrameLayoutexampleTableLayoutCommonusesUsingTableLayoutforamemorygameTimeforaction–developingasimplememorygameAbsoluteLayoutCustomLayoutsDevelopingyourownLayoutsTimeforaction–creatingacustomlayoutUsingtheCircleLayoutTimeforaction–finishingtheCircleLayoutexampleRelativeLayoutCommonusesIntegratingtheRelativeLayoutTimeforaction–creatingacontacteditorTimeforaction–integrationwiththelayoutexampleSlidingDrawerCommonusesTableofContentsivCreatingaSlidingDrawerexampleTimeforaction–creatingaSlidingDrawerTimeforaction–slidingdrawerintegrationSummaryChapter:ValidatingandHandlingInputDataDealingwithundesirableinputCorrectlylabelinginputSignalingundesirableinputRecoveringfromundesirableinputGivingusersdirectfeedbackAvoidinginvalidinputentirelyCapturingdateandtimeUsingspinnersandListViewforselectionChangingthedatasetDisablingselectionsCapturingtextinputAutocompletingtextinputBuildingactivitiesforresultsGenericfilteringsearchActivityTimeforaction–creatingtheListItemSelectionActivityTimeforaction–creatinganArrayAdapterTimeforaction–creatingtheCursorAdapterTimeforaction–settinguptheListViewTimeforaction–filteringthelistTimeforaction–returningtheselectionUsingtheListItemSelectionActivitySummaryChapter:AnimatingWidgetsandLayoutsUsingstandardAndroidanimationsTimeforaction–animatinganewsfeedUsingflipperandswitcherwidgetsUsingtheImageSwitcherandTextSwitcherimplementationsAnimatinglayoutwidgetsTimeforaction–animatingaGridViewCreatingCustomAnimationsTimeforaction–writingacustomanimationTimeforaction–makingaButtonvanishSummaryChapter:DesigningContentcentricActivitiesConsideringdesignoptionswhendisplayingcontentonanAndroiddeviceTableofContentsvConsideringuserbehaviorDrawinguserattentionDisplayingcontentwiththeWebViewclassUsingaWebViewobjectTimeforaction–creatingarecipeviewerapplicationTakingWebViewfurtherCreatingrelativelayoutsforcontentdisplayTakingfulladvantageofRelativeLayoutConsideringAndroidlayoutconstraintsStylingTextViewobjectsTimeforaction–developingspecializedcontentviewsDevelopinganonlinemusicstoreDesigningthemusicstoreDevelopingthemusicstoreTimeforaction–buildingatrackitemTimeforaction–developingthemainuserinterfacelayoutTimeforaction–developingthemainuserinterfaceJavacodeSummaryChapter:StylingAndroidApplicationsWorkingwithstyleresourcesUsingshaperesourcesHowshapesbehaveRenderinglinesTimeforaction–drawingabrokenlineRenderingrectanglesTimeforaction–creatingaroundedborderRenderingovalsTimeforaction–applyingagradienttoanovalshapeRenderingringsTimeforaction–renderingaspinnerringDefininglayersStretchingusingninepatchimagesCreatingninepatchimagesUsingbitmapimagesinAndroidHandlingdifferentscreensizesHandlingdifferentscreendensitiesHandlingconfigurationchangesProvidinglandscapelayoutsProvidingtextinputonalandscapelayoutAlteringscreencontentSummaryDownloadfromWow!eBook<wwwwowebookcom>TableofContentsviChapter:BuildinganApplicationThemeCreatingabasiccalculatorlayoutDesigningastandardcalculatorTimeforaction–buildingthestandardcalculatorBuildingthecalculatorstylingTimeforaction–creatingthebuttonimagesTimeforaction–stylingthecalculatorbuttonsTimeforaction–stylingthedisplayScientificlandscapelayoutDefiningstringresourcesforthescientificlayoutStylingthescientificlayoutBuildingthescientificlayoutTimeforaction–codingthescientificlayoutHandlingtheActivityrestartSupportinghardwarekeyboardsAddingindisplayanimationsTimeforaction–animatingthedisplaySummaryAppendix:PopquizanswersChapterLayoutsasXMLflesPopulatinganactivityChapterListviewsandadaptersChapterGalleryobjectsandImageViewsChapterIntentsActivitiesChapterCustomlayoutsChapterTextinputChapterTheWebViewwidgetWebViewversusnativelayoutsChapterLayoutresourcesNinePatchImagesAndroidresourcesIndexPrefaceOnthJanuary,,AppleofficiallylaunchedtheiPhone,andtheworldofuserinterfacedesignshiftedWhiletabletPCshadbeenaroundforawhile,theiPhonewasthefirstdevicetogivesomanypeopleaportabletouchscreen,andpeopleloveditJustoverayearlater,GoogleandtheOpenHandsetAllianceannouncedAndroidwhichinmanywaysisthedirectcompetitortoiPhoneWhatisitabouttouchscreenphonesthatweloveTheanswerissimplefeedbackTouchscreensofferawaytodirectlymanipulateonscreenobjects,whichinthepasthadtobedriventhroughakeyboard,mouse,joystick,orotherinputdeviceThetouchscreenmodelofdirectmanipulationhasalargeimpactonthewaywethinkaboutouruserinterfacesasdevelopers,andchangestheexpectationsauserhasfortheapplicationTouchscreendevicesrequireustostopthinkingintermsofforms,andstartthinkingaboutobjectorienteduserinterfacesAndroidisusedastheprimaryoperatingsystemforarapidlyexpandingrangeofconsumerelectronics,including:‹Smartphones‹Netbooks‹Tablets‹SomedesktopsystemsWhileallofthesedeviceshavedifferentpurposesandspecifications,allofthemrunAndroidThisisunlikemanyotheroperatingenvironmentswhicharealmostalwayshaveaspecialpurposeTheservicesandtheAPIstheyprovidetodevelopersgenerallyreflecttheirtargethardwareAndroidontheotherhandmakestheassumptionthatasingleapplicationmayberequiredtorunonmanydifferenttypesofdevices,withverydifferenthardwarecapabilitiesandspecifications,andmakesitaseasyaspossiblefordeveloperstohandlethedifferencesbetweenthesedevicessimplyandelegantlyPrefaceNewchallengesAsAndroidandthetouchscreendevicesitpowersbecomeincreasinglycommon,theywillbringanewsetofchallengestouserinterfacedesignanddevelopment:‹Yougenerallydon'thaveamouse‹Youmayhavemorethanonepointingdevice‹Youoftendon'thaveakeyboard‹Anykeyboardthatdoesexistmaybeasoftwarekeyboard‹Asoftwarekeyboardmayconsumesomeofyourapplication'sscreenspaceThesoftwarekeyboardreducestheamountofscreenspaceavailabletoyourapplication,andinmuchthesamevein,ifthereisahardwarekeyboardpresentitmayormaynotalwaysbeexposedtotheuserTherefore,notonlyaredifferentAndroiddevicesdifferent,buttheymayalsoappeartochangefeatureswhileyourapplicationisrunningTheruleoffingerMostAndroiddeviceshavetouchscreens(althoughthisisnotarequirement)Thefirstrestrictionplacedonanytouchscreenuserinterfaceisthesizeofthehumanforefinger,whichofcoursevarieswidelyfromonepersontoanotherIfawidgetistoosmallonthescreen,itwon'tbeclearwhattheuseristryingtotouchYou'llnoticethatmostAndroidwidgetstakeupplentyofspace,andhavemorethanthenormalamountofpaddingaroundthemOnatouchscreendevice,youcan'trelyonpixelperfectprecisionYouneedtomakesurethatwhentheusertouchesawidget,theymakecontact,andtheydon'taccidentallytouchanotherwidgetThemagictouchAnotherimpacttouchscreenshaveonuserinterfacedesignisthatanapplicationandallthewidgetsthatitusesmustbeentirelyselfexplanatory(evenmorethanusual)Fartoooften,wesubstitutegooduserinterfaceplanninganddesignwitharolloverortooltiptoindicateawidget'sfunctionOnatouchscreendevice,thereisnomouseorpointingdeviceThefirstinteractionithaswiththeuseriswhentheytouchit,andtheywillexpectsomethingtohappenAtouchysubjectMostAndroiddeviceshaveatouchscreen,butit'snotarequirementThequalityofatouchscreenalsovarieswildlyfromdevicetodeviceThecategoryoftouchscreensandtheircapabilitieswillalsovaryfromonedevicetothenext,dependingontheintendeduseofthedeviceandoftenitsintendedmarketsegmentPrefaceAsmallerviewontheworldMostAndroiddevicesaresmall,andasaresulthavesmallerscreensandgenerallyfewerpixelsthananormalPCorlaptopThislackofsizelimitsthesizeofthewidgetsWidgetsmustbebigenoughtotouchsafely,butwealsoneedtopackasmuchinformationontothescreenaspossibleSodon'tgiveyourusersinformationthattheydon'twant,andalsoavoidaskingthemforinformationyoudon'tneedClassicuserinterfaceprincipalsHerearesomecoreguidelineswhicheveryuserinterfaceshouldfollowTheseguidelinesarewhatwillkeepyourusershappy,andensureyourapplicationissuccessfulThroughouttherestofthebook,we'llbewalkingthroughtheseguidelineswithpracticalexamplesofimprovementsthatcanbemadetoauserinterfaceConsistencyThisisthecornerstoneofgooduserinterfacedesignAbuttonshouldlooklikeabuttonMakesurethatthelayoutofeachscreenhasarelationshipwitheveryotherscreeninyourapplicationPeopleoftenmistakethisprinciplefor"sticktotheplatformlookandfeel"Lookandfeelisimportant,consistencymostlyappliestothelayoutandoverallexperienceoftheapplication,ratherthanthecolorschemeRecyclingyourinterfaceTheeasiestwaytomaintainaconsistentuserinterface,istorecycleasmuchofitaspossibleAtfirstglance,thissuggestionlooksmerelylikea"goodobjectoriented"practiceHowever,acloserlookwillrevealwaystoreusegraphicalwidgetsinwaysyouhadn'tthoughtofBychangingthevisibilityofvariouswidgets,oryoucanreuseaneditscreentoviewlistitemsoftheintendedtypeSimplicityThisisespeciallyimportantinaphonebasedapplicationOften,whenauserencountersanewapplication,it'sbecausetheyarelookingforsomethingTheymaynothavethetime(ormoreoftenpatience)tolearnanewuserinterfaceMakesurethatyourapplicationasksforaslittleaspossible,andguidestheusertotheexactinformationtheywantinasfewstepsaspossiblePrefaceTheZenapproachGenerally,whenyouareusingamobiledevice,yourtimeislimitedYoumayalsobeusinganapplicationinlessthanidealcircumstances(perhaps,inatrain)Thelesserinformationauserneedstogiveanapplication,andthelessertheyneedtoabsorbfromit,thebetterStrippingawayoptionsandinformationalsoleadstoashorterlearningcurveAndroid'shiddenmenuAveryusefulfeatureofAndroidisthehiddenmenustructureThemenuisonlyvisiblewhentheuserpressesthe"Menu"button,whichwouldgenerallymean,they'relookingforsomethingthatisn'tcurrently

职业精品

用户评论

0/200
    暂无评论

精彩专题

上传我的资料

热门资料

资料评价:

/49
禁止下载

意见
反馈

返回
顶部

Q