Head First Android Development.pdf

(47865 KB) Pobierz
Head First
Android Development
Wouldn’t it be dreamy if
there was a book on Android
development that could turn me
into an expert while keeping me
engaged and entertained? But it’s
probably just a fantasy...
Jonathan Simon
Beijing • Cambridge • Farnham • Kln • Sebastopol • Taipei • Tokyo
www.it-ebooks.info
Head First Android Development
by Jonathan Simon
Copyright © 2011 Jonathan Simon. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly Media books may be purchased for educational, business, or sales promotional use. Online editions are
also available for most titles (safari.oreilly.com). For more information, contact our corporate/institutional sales
department: (800) 998-9938 or
corporate@oreilly.com.
Series Creators:
Editor:
Cover Designers:
Production Editor:
Indexer:
Proofreader:
Page Viewers:
Printing History:
October 2011: First Edition.
Kathy Sierra, Bert Bates
Brian Sawyer
Karen Montgomery
TK
TK
TK
Felisa
Felisa
The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. The
Head First
series designations,
Head First Android Development
and related trade dress are trademarks of O’Reilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a trademark
claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and the authors assume no
responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.
ISBN: 978-1-449-39330-4
[M]
www.it-ebooks.info
dedication
This book is dedicated to our dog...
Our super-cute
dog, Ella, that
sadly passed away.
We love you!!
Ella Simon
2002 - 2011
I miss
you Ella!
Ella’s sister,
Billie
you are here
4
iii
www.it-ebooks.info
the
author
Author of He ad First Android Development
Jonathan Simon
Before the modern smartphone era,
Jonathan Simon
was coding away at the
cool phones of the day, writing low level UI
frameworks and debugging tiny screens (back
when 176x220 was huge!) with a magnifying
glass. Since then, he’s worked with all kinds
of phones, even the new ones with big fancy
schmancy screens.
Before working with mobile devices, Jonathan
spent a good six years working on Wall Street
designing and building user interfaces for
trading systems. And no, it’s not his fault the
stock market tanked, honest! He also can’t give
you any stock tips. (Sorry!)
When he’s not coding or designing, he’s
probably hanging out with his wife, Felisa,
or their dog, Billie. Otherwise, he’s probably
riding (or building) a bike or perfecting his
espresso extraction.
One of Jonathan’s espresso
shots. It took MANY of
these to write this book.
iv
www.it-ebooks.info
table
of
contents
Table of Contents (Summary)
Intro
1
2
3
4
5
6
7
8
9
10
11
12
i
Your first app:
Meet Android
Give your app an action:
Adding behavior
Pictures from space:
Work with feeds
When things take time:
Long-running processes
Run your app everywhere:
Multiple-device support
Tablets are not just big phones:
Optimizing for tablets
Building a list-based app:
Lists and adapters
Navigation in Android:
Multi-screen apps
Database persistence:
Store your stuff with SQLite
RelativeLayout:
It’s all relative
Give your app some polish:
Tweaking your UI
Make the most of what you can use:
Content proficers
Leftovers: The
Top Ten Things (We Didn’t Cover)
167
205
265
313
345
393
xi
1
41
79
123
Table of Contents (the real thing)
Your First App
So you’re thinking: “What makes Android so special?”
Android is a
free and open operating system
from
Google
that runs on all kinds
of devices from
phones,
to
tablets
and even
televisions.
That’s a ton of different
devices you can target with
just one platform!
(And the market share is gaining
too!) Google provides all of the stuff you need to get started building Android apps
for free.
You can build your Android apps on Macs, Windows, or Unix and publish
your apps for next to nothing (with no need for anyone’s approval). Ready to get
started? Great! You’re going to start building your first Android app, but first there
are a few things to set up...
v
www.it-ebooks.info
Zgłoś jeśli naruszono regulamin