The Busy Coder's Guide to Android Develo - Murphy_ Mark L_.pdf

(12512 KB) Pobierz
686450993 UNPDF
686450993.008.png 686450993.009.png 686450993.010.png 686450993.011.png 686450993.001.png 686450993.002.png 686450993.003.png 686450993.004.png
The Busy Coder's Guide to Android
Development
by M ark L. M urphy
686450993.005.png
The Busy Coder's Guide to Android Development
by Mark L. M urphy
Copyright © 2008-2011 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 3.6 ISBN: 978-0-9816780-0-9
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!. ......................................................xxiii
Preface. ...............................................................................................xxv
Welcome to the Book! . .............................................................................xxv
Warescription . ..........................................................................................xxv
Book Bug Bounty . ....................................................................................xxvi
Source Code And Its License . ................................................................xxvii
Acknowledgments . ..................................................................................xxix
The Big Picture. ......................................................................................1
What Androids Are Made Of . ......................................................................3
Activities . ................................................................................................3
Services . ..................................................................................................4
Content Providers . .................................................................................4
Intents . ....................................................................................................4
Stuff At Your Disposal . .................................................................................5
Storage . ...................................................................................................5
Network . .................................................................................................5
Multimedia . ............................................................................................5
GPS . .........................................................................................................5
iii
686450993.006.png
Phone Services . ......................................................................................6
The Big Picture...Of This Book . ...................................................................6
How To Get Started. ...............................................................................7
Step #1: Java . ..................................................................................................7
Install the JDK ........................................................................................7
Learn Java . ..............................................................................................8
Step #2: Install the Android SDK . ...............................................................9
Install the Base Tools . ............................................................................9
Install the SDKs and Add-Ons . .............................................................9
Step #3: Install the ADT for Eclipse . ..........................................................13
Step #4: Install Apache Ant . .......................................................................15
Step #5: Set Up the Emulator . ....................................................................16
Step #6: Set Up the Device . ........................................................................23
Windows . ..............................................................................................24
OS X and Linux . ....................................................................................25
Your First Android Project...................................................................27
Step #1: Create the New Project . ................................................................27
Eclipse . ..................................................................................................27
Command Line . .....................................................................................31
Device . .........................................................................................................32
Eclipse . ..................................................................................................32
Command Line . ....................................................................................33
Examining Your First Project...............................................................37
Project Structure . ........................................................................................37
Root Contents . ......................................................................................37
The Sweat Off Your Brow . ...................................................................38
iv
686450993.007.png
Zgłoś jeśli naruszono regulamin