Androidmanifest.Xml
Total Page:16
File Type:pdf, Size:1020Kb
CYAN YELLOW SPOT MATTE MAGENTA BLACK PANTONE 123 C ® Companion BOOKS FOR PROFESSIONALS BY PROFESSIONALS eBook Available ndroid, Google’s open-source platform for mobile development, has Pro Athe momentum to become the leading mobile platform. Pro Android 2 Covers Google’s Android 2 Platform including advanced shows you how to build real-world mobile apps using Google’s Android SDK. Android is easy to learn yet comprehensive, and is rich in functionality. topics such as OpenGL, Widgets, Text to Speech, The absence of licensing fees for Android OS has borne fruit already with many Multi-Touch, and Titanium Mobile distinct device manufacturers and a multiplicity of models and carriers. Indi- vidual developers have a great opportunity to publish mobile applications on 2 Android the Android Market; in only five months’ time the number of applications has doubled, with over 20,000 available today. And the widespread use of Android has increased demand for corporate developers as companies are looking for a mobile presence. You can be part of this. With real-world source code in hand, Pro Android 2 covers mobile application development for the Android platform from basic concepts such as Android Resources, Intents, and Content Providers to OpenGL, Text to Speech, Multi- touch, Home Screen Widgets, and Titanium Mobile. We teach you how to build Android applications by taking you through Android APIs, from basic to ad- vanced, one step at a time. Android makes mobile programming far more accessible than any other mobile platforms available today. At no cost to you, you can download the Eclipse IDE and the Android SDK, and you will have everything you need to start writing great applications for Android mobile devices. You will not even need a physical device—the Android SDK provides an emulator that you can run on your desktop. Pro Android 2 is the result of over two years of effort to bring together in one place everything you need—both basic and advanced—to be an Android developer. So what are you waiting for? Pro Android 2 Komatineni s MacLean Hashimi Sayed Hashimi | Satya Komatineni | Dave MacLean COMPANION eBOOK SEE LAST PAGE FOR DETAILS ON $10 eBOOK VERSION ISBN 978-1-4302-2659-8 5 49 9 9 US $49.99 Shelve in Mobile Computing SOURCE CODE ONLINE User level: www.apress.com Intermediate-Advanced 9 781430 226598 this print for content only—size & color not accurate Trim: 7.5 x 9.25 spine = 1.375" 736 page count Pro Android 2 ■ ■ ■ Sayed Y. Hashimi Satya Komatineni Dave MacLean i Pro Android 2 Copyright © 2010 by Sayed Y. Hashimi, Satya Komatineni, and Dave MacLean All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. ISBN-13 (pbk): 978-1-4302-2659-8 ISBN-13 (electronic): 978-1-4302-2660-4 Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1 Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. President and Publisher: Paul Manning Lead Editor: Steve Anglin Development Editor: Douglas Pundick Technical Reviewer: Vikram Goyal Editorial Board: Clay Andres, Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Jonathan Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, Duncan Parkes, Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh Coordinating Editor: Fran Parnell Copy Editor: Elizabeth Berry Compositor: MacPS, LLC Indexer: BIM Indexing & Proofreading Services Artist: April Milne Cover Designer: Anna Ishchenko Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail orders- [email protected], or visit www.springeronline.com. For information on translations, please e-mail [email protected], or visit www.apress.com. Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook versions and licenses are also available for most titles. For more information, reference our Special Bulk Sales–eBook Licensing web page at www.apress.com/info/bulksales. The information in this book is distributed on an “as is” basis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. The source code for this book is available to readers at www.apress.com. You will need to answer questions pertaining to this book in order to successfully download the code. ii To my son, Sayed-Adieb. —Sayed Y. Hashimi To my beautiful wife, AnnMarie, for her spirit; to Ashley, for her undaunting hope; to Nikolas, for his kindness; to Kavitha, for being smart, witty, and fabulous; to Narayan, for sheer cuteness; and to all my extended family in India and the USA for their love. —Satya Komatineni To my wife, Rosie, and my son, Mike, for their support; I couldn't have done this without them. And to Max, for spending so much time at my feet keeping me company. —Dave MacLean iii Contents at a Glance ■Contents at a Glance...................................................................................................iv ■Contents.......................................................................................................................v ■About the Authors.....................................................................................................xiii ■About the Technical Reviewer ..................................................................................xiv ■Acknowledgments .....................................................................................................xv ■Foreword...................................................................................................................xvi ■Chapter 1: Introducing the Android Computing Platform ........................................... 1 ■Chapter 2: Getting Your Feet Wet.............................................................................. 25 ■Chapter 3: Using Resources, Content Providers, and Intents ................................... 57 ■Chapter 4: Building User Interfaces and Using Controls......................................... 123 ■Chapter 5: Working with Menus and Dialogs.......................................................... 171 ■Chapter 6: Unveiling 2D Animation......................................................................... 217 ■Chapter 7: Exploring Security and Location-Based Services.................................. 243 ■Chapter 8: Building and Consuming Services......................................................... 289 ■Chapter 9: Using the Media Framework and Telephony APIs................................. 327 ■Chapter 10: Programming 3D Graphics with OpenGL ............................................. 363 ■Chapter 11: Managing and Organizing Preferences ............................................... 421 ■Chapter 12: Exploring Live Folders......................................................................... 439 ■Chapter 13: Home Screen Widgets ......................................................................... 457 ■Chapter 14: Android Search.................................................................................... 491 ■Chapter 15: Exploring Text to Speech and Translate APIs...................................... 563 ■Chapter 16: Touchscreens ...................................................................................... 591 ■Chapter 17: Titanium Mobile: A WebKit-Based Approach to Android Development ....................................................................................... 627 ■Chapter 18: Working with Android Market ............................................................. 661 ■Chapter 19: Outlook and Resources ....................................................................... 675 ■Index ....................................................................................................................... 687 iv Contents ■Contents at a Glance....................................................................................... iv ■Contents .......................................................................................................... v ■About the Authors ........................................................................................ xiii ■About the Technical Reviewer.......................................................................xiv ■Acknowledgments..........................................................................................xv ■Foreword .......................................................................................................xvi ■Chapter 1: Introducing the Android Computing Platform................................ 1 A New Platform for a New Personal Computer.......................................................................................................1 History of Android ...................................................................................................................................................3