Android™ Wireless Application Development, Third Edition doc

525 758 0
  • Loading ...
    Loading ...
    Loading ...

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Tài liệu liên quan

Thông tin tài liệu

Ngày đăng: 07/03/2014, 02:20

ptg8286261www.it-ebooks.infoptg8286261Android™WirelessApplicationDevelopmentVolume II: Advanced TopicsThird Editionwww.it-ebooks.infoptg8286261This page intentionally left blank www.it-ebooks.infoptg8286261Android™WirelessApplicationDevelopmentVolume II: Advanced TopicsThird EditionLauren DarceyShane ConderUpper Saddle River, NJ • Boston • Indianapolis • San FranciscoNew York • Toro nt o • Montreal • London • Munich • Paris • MadridCape Town • Sydney • Tok yo • Singapore • Mexico Citywww.it-ebooks.infoptg8286261Many of the designations used by manufacturers and sellers to distinguish their productsare claimed as trademarks. Where those designations appear in this book, and thepublisher was aware of a trademark claim, the designations have been printed with initialcapital letters or in all capitals.The authors and publisher have taken care in the preparation of this book, but make noexpressed or implied warranty of any kind and assume no responsibility for errors oromissions. No liability is assumed for incidental or consequential damages in connectionwith or arising out of the use of the information or programs contained herein.The publisher offers excellent discounts on this book when ordered in quantity for bulkpurchases or special sales, which may include electronic versions and/or custom coversand content particular to your business, training goals, marketing focus, and brandinginterests. For more information, please contact:U.S. Corporate and Government Sales(800) 382-3419corpsales@pearsontechgroup.comFor sales outside the United States, please contact:International Salesinternational@pearsoned.comVisit us on the Web: informit.com/awLibrary of Congress Cataloging-in-Publication Data is on file.Copyright © 2012 Lauren Darcey and Shane ConderAll rights reserved. Printed in the United States of America. This publication is protected bycopyright, and permission must be obtained from the publisher prior to any prohibitedreproduction, storage in a retrieval system, or transmission in any form or by any means,electronic, mechanical, photocopying, recording, or likewise. To obtain permission to usematerial from this work, please submit a written request to Pearson Education, Inc.,Permissions Department, One Lake Street, Upper Saddle River, New Jersey 07458, or youmay fax your request to (201) 236-3290.Android is a trademark of Google, Inc. Pearson Education does not assert any right to theuse of the Android trademark, and neither Google nor any other third party having any claimin the Android trademark have sponsored or are affiliated with the creation anddevelopment of this book.Some figures that appear in this book have been reproduced from or are modificationsbased on work created and shared by the Android Open Source Project and used accordingto terms described in the Creative Commons 2.5 Attribution license(http://creativecommons.org/licenses/by/2.5/).ISBN-13: 978-0-321-81384-8ISBN-10: 0-321-81384-7Tex t pri nte d in the Uni ted S tat es on r ecycl ed paper a t R.R . Don nel ley in C rawf ord svi lle ,Indiana.First printing, July 2012Editor-in-ChiefMark TaubAcquisitions EditorLaura LewinDevelopmentEditorSonglin QiuManaging EditorKristy HartProject EditorBetsy HarrisCopy EditorDeadline-DrivenPublishingIndexerLisa StumpfProofreaderPaula LowellTechnicalReviewersTony H ill erso nDouglas JonesRay RischpaterPublishingCoordinatorOlivia BasegioMultimediaDeveloperDan ScherfBook DesignerGary AdairSenior CompositorGloria Schurickwww.it-ebooks.infoptg8286261❖This book is dedicated to ESC.❖www.it-ebooks.infoptg8286261This page intentionally left blank www.it-ebooks.infoptg8286261ContentsIntroduction 1I: Advanced Android Application Design Principles1 Threading and Asynchronous Processing 9The Importance of Processing Asynchronously 9Working with the AsyncTask Class 10Working with the Thread Class 13Working with Loaders 14Understanding StrictMode 14Summary 15References and More Information 152 Working with Services 17Determining When to Use Services 17Understanding the Service Lifecycle 18Creating a Service 18Controlling a Service 23Implementing a Remote Interface 24Implementing a Parcelable Class 26Using the IntentService Class 29Summary 33References and More Information 333 Leveraging SQLite Application Databases 35Storing Structured Data Using SQLite Databases 35Creating a SQLite Database 36Creating, Updating, and Deleting Database Records 38Working with Transactions 40www.it-ebooks.infoptg8286261Querying SQLite Databases 41Closing and Deleting a SQLite Database 46Designing Persistent Databases 47Binding Data to the Application User Interface 50Summary 55References and More Information 554 Building Android Content Providers 57Acting as a Content Provider 57Implementing a Content Provider Interface 58Defining the Data URI 59Defining Data Columns 59Implementing Important Content Provider Methods 59Updating the Manifest File 65Enhancing Applications Using Content Providers 65Accessing Images on the Device 66Summary 71References and More Information 715 Broadcasting and Receiving Intents 73Sending Broadcasts 73Sending Basic Broadcasts 74Sending Ordered Broadcasts 74Receiving Broadcasts 75Registering to Receive Broadcasts 76Handling Incoming Broadcasts from the System 77Securing Application Broadcasts 80Summary 80References and More Information 81viiiContentswww.it-ebooks.infoptg8286261ixContents6 Working with Notifications 83Notifying the User 83A Word on Compatibility 84Notifying with the Status Bar 84Using the NotificationManager Service 85Creating a Simple Text Notification with an Icon 85Working with the Notification Queue 86Updating Notifications 88Clearing Notifications 90Vibrating the Phone 91Blinking the Lights 92Making Noise 93Customizing the Notification 94Designing Useful Notifications 96Summary 97References and More Information 97II: Advanced Android User Interface Design Principles7 Designing Powerful User Interfaces 99Following Android User Interface Guidelines 99Working with Menus 100Using Options Menus 100Using Context Menus 103Using Popup Menus 105Enabling Action Bars 105Building Basic Action Bars 106Customizing Your Action Bar 110Handling Application Icon Clicks on the Action Bar 112Working with Screens That Do Not Require Action Bars 114Introducing Contextual Action Mode 114Using Advanced Action Bar Features 114www.it-ebooks.info[...]... he should be writing his own bio The authors have also published several other Android books, including Android Wireless Application Development, Android Wireless Application Development Volume I: Android Essentials, Sams Teach Yourself Android Application Development, Learning Android™ Application Programming for the Kindle Fire™, and the mini-book Introducing Android Development with Ice Cream Sandwich... and profit Why Two Volumes in the Third Edition? We wrote the first edition of this book before the Android SDK was released Now, three years and 14 Android SDK releases later, there is so much to talk about that we’ve had to divide the content of the Android wireless application development process into two separate volumes for this, the third edition Android Wireless Application Development Volume I:... Market InApplication Billing APIs, Google Analytics APIs, and more Android Wireless Application Development Volume II: Advanced Topics is divided into seven parts Here is an overview of the various parts in this book: n n Part I: Advanced Android Application Design Principles Part I picks up where Android Wireless Application Development Volume I: Android Essentials leaves off in terms of application. .. 2 How are Android applications structured? How are background operations handled with services? What are broadcast intents and how can applications use them effectively? 3 How do applications store data persistently using SQLite? How can applications act as content providers and why would they want to do so? 4 How do applications interact with the Android operating system? How do applications trigger... Agent 408 409 Backing Up and Restoring Application Data Summary 412 414 References and More Information 414 VI: Advanced Topics in Application Publication and Distribution 26 Internationalizing Your Applications 415 Internationalizing Applications 415 Internationalization Using Alternative Resources 416 Implementing Locale Support Programmatically 421 Publishing Applications for Foreign Users Summary... n n n n n If your application is not responsive enough, it might be plagued with Application Not Responding (ANR) events ANR events occur when the Android operating system www.it-ebooks.info 10 Chapter 1 Threading and Asynchronous Processing decides that your application is not responding in a reasonable time and shuts that application down.Typically, these events happen when your application takes... Pioneered byplatform that has taken the wireless worldAndroid is a popular, free, openthe Open Handset Alliance and Google, source mobile by storm.This book and Android Wireless Application Development Volume I: Android Essentials provide comprehensive guidance for software development teams on designing, developing, testing, debugging, and distributing professional Android applications If you’re a veteran... Enabling Application Search 384 385 Making Application Content Searchable 385 Enabling Searches in Your Application Enabling Global Search Summary 386 395 398 References and More Information 398 24 Working with Cloud to Device Messaging An Overview of C2DM 399 399 Understanding C2DM Message Flow 400 Understanding the Limitations of the C2DM Service 400 Signing Up for C2DM 401 Incorporating C2DM into Your Applications... essentials, including setting up your development environment, understanding the application lifecycle and the user interface design, developing for different types of devices, and understanding the mobile software process from design and development to testing and publication of commercial-grade applications Android Wireless Application Development Volume II: Advanced Topics focuses on advanced Android... sensors, animation, graphics, and more Coverage of advanced Android application components, such as services, application databases, content providers, and intents, is also included Developers learn to design advanced user interface components and integrate their applications deeply into the platform Finally, developers learn how to extend their applications beyond traditional boundaries using optional features . ptg8286261www.it-ebooks.infoptg8286261Android™ Wireless Application DevelopmentVolume II: Advanced Topics Third Edition www.it-ebooks.infoptg8286261This. blank www.it-ebooks.infoptg8286261Android™ Wireless Application DevelopmentVolume II: Advanced Topics Third Edition Lauren DarceyShane ConderUpper Saddle
- Xem thêm -

Xem thêm: Android™ Wireless Application Development, Third Edition doc, Android™ Wireless Application Development, Third Edition doc, Android™ Wireless Application Development, Third Edition doc

Từ khóa liên quan

Mục lục

Xem thêm