Hello Android 3e - Burnette - Pragmatic (2010) - Android 1.5 to 2.2 only.pdf

(6009 KB) Pobierz
813339634.044.png
What Readers Are Saying About Hello, Android
Learn to develop Android apps with this complete yet gentle introduc-
tion to the Android platform. Out of all the books on Android, Hello,
Android has the best flow and coverage for developers new to this plat-
form. You’ll be writing Android apps in no time!
Marko Gargenta
CEO, , Marakana.com
The third edition of Hello, Android gets you on the fast track of
Android application development, from the basic concepts to pub-
lishing to the Android Market. Ed shows his vast experience on the
subject and even covers hard-to-find topics such as multi-touch and
OpenGL. This is a must-read for everyone starting on the fascinating
journey of Android development.
Diego Torres Milano
Android expert and blogger,
I thoroughly enjoyed the Hello, Android book, and it helped me get on
the right track to releasing my first two apps to the Market.
Nathan Rapp
Founder, , KMBurrito Designs
More than a greeting, Hello, Android welcomes both beginners and
pros to Android development.
Michael Martin PMP
Founder, , GoogleAndBlog and Mobile Martin
813339634.045.png 813339634.046.png 813339634.047.png 813339634.001.png
Hello, Android
Introducing Google’s
Mobile Development Platform, 3rd Edition
Ed Burnette
The Pragmatic Bookshelf
Raleigh, North Carolina
Dallas, Texas
 
Many of the designations used by manufacturers and sellers to distinguish their prod-
ucts are claimed as trademarks. Where those designations appear in this book, and The
Pragmatic Programmers, LLC was aware of a trademark claim, the designations have
been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The
Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g
device are trademarks of The Pragmatic Programmers, LLC.
Portions of the book’s cover are reproduced from work created and shared by Google and
used according to terms described in the Creative Commons 2.5 Attribution License. See
Gesture icons in Chapter 11 courtesy of GestureWorks (www.gestureworks.com).
Every precaution was taken in the preparation of this book. However, the publisher
assumes no responsibility for errors or omissions, or for damages that may result from
the use of information (including program listings) contained herein.
Our Pragmatic courses, workshops, and other products can help you and your team
create better software and have more fun. For more information, as well as the latest
Pragmatic titles, please visit us at http://www.pragprog.com .
The team that produced this book includes:
Editor:
Susannah Davidson Pfalzer
Indexing:
Seth Maislin
Copy edit:
Kim Wimpsett
Layout:
Steve Peter
Production:
Janet Furlow
Customer support:
Ellie Callahan
International:
Juliet Benda
Copyright © 2010 Pragmatic Programmers, LLC.
All rights reserved.
No part of this publication may be reproduced, stored in a retrieval system, or transmit-
ted, in any form, or by any means, electronic, mechanical, photocopying, recording, or
otherwise, without the prior consent of the publisher.
Printed in the United States of America.
ISBN-10: 1-934356-56-5
ISBN-13: 978-1-934356-56-2
Printed on acid-free paper.
P1.0 printing, July 2010
Version: 2010-7-16
813339634.002.png 813339634.003.png 813339634.004.png 813339634.005.png 813339634.006.png 813339634.007.png 813339634.008.png 813339634.009.png 813339634.010.png 813339634.011.png 813339634.012.png 813339634.013.png 813339634.014.png 813339634.015.png 813339634.016.png 813339634.017.png 813339634.018.png 813339634.019.png 813339634.020.png 813339634.021.png 813339634.022.png 813339634.023.png 813339634.024.png 813339634.025.png 813339634.026.png 813339634.027.png 813339634.028.png 813339634.029.png 813339634.030.png 813339634.031.png 813339634.032.png 813339634.033.png 813339634.034.png 813339634.035.png 813339634.036.png 813339634.037.png 813339634.038.png 813339634.039.png 813339634.040.png 813339634.041.png 813339634.042.png 813339634.043.png
Contents
9
10
. . . . . . . . . . . . . . . . . .
10
Who Should Read This Book? . . . . . . . . . . . . . . . . . . .
11
What’s in This Book? . . . . . . . . . . . . . . . . . . . . . . . .
12
What’s New in the Third Edition? . . . . . . . . . . . . . . . . .
12
Online Resources . . . . . . . . . . . . . . . . . . . . . . . . . .
14
. . . . . . . . . . . . . . . . . . . . . . . . . .
14
I
Introducing Android
16
1
Quick Start
17
1.1
Installing the Tools
. . . . . . . . . . . . . . . . . . . . .
17
1.2
Creating Your First Program . . . . . . . . . . . . . . . .
23
1.3
Running on the Emulator
. . . . . . . . . . . . . . . . .
23
1.4
Running on a Real Phone
. . . . . . . . . . . . . . . . .
28
1.5
Fast-Forward >> . . . . . . . . . . . . . . . . . . . . . . .
29
2
Key Concepts
30
2.1
The Big Picture
. . . . . . . . . . . . . . . . . . . . . . .
30
2.2
It’s Alive!
. . . . . . . . . . . . . . . . . . . . . . . . . . .
35
2.3
Building Blocks
. . . . . . . . . . . . . . . . . . . . . . .
39
2.4
Using Resources
. . . . . . . . . . . . . . . . . . . . . .
40
2.5
Safe and Secure . . . . . . . . . . . . . . . . . . . . . . .
40
2.6
Fast-Forward >> . . . . . . . . . . . . . . . . . . . . . . .
41
 
Zgłoś jeśli naruszono regulamin