The Busy Coder's Guide to Advanced Android Development 1.9.2e for Android 3.0 - Murphy - CommonsWare (2011).pdf

(11117 KB) Pobierz
779966929.015.png 779966929.016.png 779966929.017.png 779966929.018.png 779966929.001.png 779966929.002.png 779966929.003.png 779966929.004.png 779966929.005.png 779966929.006.png 779966929.007.png 779966929.008.png 779966929.009.png 779966929.010.png
The Busy Coder's Guide to Advanced Android
Development
by M ark L. M urphy
779966929.011.png 779966929.012.png
The Busy Coder's Guide to Advanced Android Development
by Mark L. M urphy
Copyright © 2009-11 CommonsW are, LLC. All Rights Reserved.
Printed in the United States of America.
CommonsW are books may be purchased in printed (bulk) or digital form for educational or
business use. F or more information, contact direct@commonsware.com .
Printing History:
Mar 2011:V ersion 1.9.2
ISBN: 978-0-9816780-1-6
The CommonsW are name and logo, “Busy Coder's Guide”, and related trade dress are
trademarks of CommonsW are, LLC.
All other trademarks referenced in this book are trademarks of their respective firms.
The publisher and author(s) assume no responsibility for errors or omissions or for damages
resulting from the use of the information contained herein.
able of Contents
Welcome to the Warescription!..........................................................xix
Preface.................................................................................................xxi
Welcome to the Book! . ..............................................................................xxi
Prerequisites . .............................................................................................xxi
Warescription . .........................................................................................xxiii
Errata and the Book Bug Bounty . ...........................................................xxiii
Source Code . .............................................................................................xxv
Lifecycle of a CommonsWare Book . ......................................................xxvi
WebView, Inside and Out.......................................................................1
Friends with Benefits ....................................................................................1
Turnabout is Fair Play . .................................................................................7
Crafting Your Own Views......................................................................13
Pick Your Poison . .........................................................................................13
Colors, Mixed How You Like Them ...........................................................15
The Layout . ...........................................................................................16
The Attributes . ......................................................................................18
The Class . ..............................................................................................19
Seeing It In Use . ...................................................................................24
iii
779966929.013.png
More Fun With ListViews.....................................................................27
Giant Economy-Size Dividers . ...................................................................27
Choosing What Is Selectable . .............................................................28
Introducing MergeAdapter . ................................................................29
Lists via Merges . ...................................................................................30
How MergeAdapter Does It . ................................................................33
From Head To Toe . ....................................................................................36
Control Your Selection . ..............................................................................39
Create a Unified Row View . ................................................................40
Configure the List, Get Control on Selection . ....................................41
Change the Row . ..................................................................................43
Stating Your Selection . ...............................................................................45
Creating Drawables..............................................................................47
Traversing Along a Gradient . ....................................................................47
State Law . .....................................................................................................51
A Stitch In Time Saves Nine . .....................................................................53
The Name and the Border . ..................................................................54
Padding and the Box . ...........................................................................54
Stretch Zones . .......................................................................................55
Tooling . .................................................................................................56
Using Nine-Patch Images . ...................................................................58
Home Screen App Widgets...................................................................63
East is East, and West is West.... ............................................................... 64
The Big Picture for a Small App Widget . .................................................64
Crafting App Widgets . ...............................................................................65
The Manifest . .......................................................................................66
The Metadata . ......................................................................................67
iv
779966929.014.png
Zgłoś jeśli naruszono regulamin