ebook img

Android Development Patterns: Best Practices for Professional Developers PDF

316 Pages·2016·15.88 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Android Development Patterns: Best Practices for Professional Developers

ptg16707593 Android Development ™ Patterns ptg16707593 This page intentionally left blank ptg16707593 Android Development ™ Patterns Best Practices for Professional Developers ptg16707593 Phil Dutson Boston • C olumbus • I ndianapolis • N ew York • S an Francisco • A msterdam • Cape Town Dubai • L ondon • M adrid • M ilan • M unich • P aris • M ontreal • Toronto • D elhi Mexico City • S ão Paulo • Sidney • H ong Kong • Seoul • S ingapore • T aipei • T okyo Many of the designations used by manufacturers and sellers to distinguish their Editor-in-Chief products are claimed as trademarks. Where those designations appear in this book, Mark Taub and the publisher was aware of a trademark claim, the designations have been printed Executive Editor with initial capital letters or in all capitals. Laura Lewin The author and publisher have taken care in the preparation of this book, but make Development Editor no expressed or implied warranty of any kind and assume no responsibility for errors Sheri Replin or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained Managing Editor herein. Kristy Hart Project Editor For information about buying this title in bulk quantities, or for special sales opportunities (which may include electronic versions; custom cover designs; and Elaine Wiley content particular to your business, training goals, marketing focus, or branding Copy Editor interests), please contact our corporate sales department at c orpsales@pearsoned. Bart Reed com or (800) 382-3419. Indexer For government sales inquiries, please contact [email protected] . Tim Wright For questions about sales outside the U.S., please contact i [email protected] . Proofreader Laura Hernandez Visit us on the Web: informit.com/aw Technical Reviewers Library of Congress Control Number: 2015958569 Romin Irani Douglas Jones Copyright © 2016 Pearson Education, Inc. Raymond Rischpater All rights reserved. Printed in the United States of America. This publication is Editorial Assistant protected by copyright, and permission must be obtained from the publisher prior to Olivia Basegio any prohibited reproduction, storage in a retrieval system, or transmission in any form Cover Designer or by any means, electronic, mechanical, photocopying, recording, or likewise. For Chuti Prasertsith information regarding permissions, request forms and the appropriate contacts within the Pearson Education Global Rights & Permissions Department, please visit w ww. Compositor ptg16707593 pearsoned.com/permissions/ . Nonie Ratcliff Google Play is a trademark of Google, Inc. Android is a trademark of Google, Inc. ISBN-13: 978-0-133-92368-1 ISBN-10: 0-133-92368-1 Text printed in the United States on recycled paper at RR Donnelley in Crawfordsville, Indiana. First printing: February 2016 ❖ To all of those who believe in magic, especially the digital kind. ❖ ptg16707593 This page intentionally left blank ptg16707593 vviiii Contents Preface xiv 1 Development Tools 1 Android Studio 1 Installing Android Studio 2 Using Android Studio 4 Starting a New Project 6 Standalone SDK Tools 9 Android Device Emulation 10 Android Virtual Device 11 GenyMotion 12 Xamarin Android Player 13 Version-Control Systems 14 Subversion 14 Git 14 Mercurial 15 ptg16707593 Summary 15 2 Testing and Debugging 17 Unit Testing 17 Integration Testing 20 Debugging 25 Profiling 25 Tracing 27 Messaging 29 Summary 32 3 Application Structure 33 Manifests 34 Java 36 Res (Resources) 37 Drawable 37 Layout 39 Menu 39 vviiiiii CCoonntteennttss Values 40 Other Resources 41 Gradle 41 Summary 42 4 Components 45 Intents 45 Intent Filters 46 Broadcast Receivers 47 Activities 48 Creating an Activity 48 Activity Lifecycle 49 Fragments 52 Creating a Fragment 52 Communicating with Fragments 55 Loaders 56 Summary 58 ptg16707593 5 Views 59 The View Class 59 The AnalogClock Subclass 60 The ImageView Subclass 60 The KeyboardView Subclass 60 The MediaRouteButton Subclass 62 The ProgressBar Subclass 62 The Space Subclass 64 The SurfaceView Subclass 64 The TextView Subclass 65 The TextureView Subclass 65 The ViewGroup Subclass 66 The ViewStub Subclass 68 Creating a Custom View 68 Summary 70 Contents iixx 6 Layout 71 Layout Basics 71 Layout Measurements 72 Layout Coordinates 73 Layout Containers 74 Linear Layout 74 Relative Layout 76 Table Layout 79 Frame Layout 80 WebView 82 Summary 83 7 App Widgets 85 App Widget Layouts 86 The AppWidgetProviderInfo Object 88 App Widget Sizing 89 Update Frequency 90 Preview Image 90 ptg16707593 Widget Category 92 Widget Category Layout 92 Resizable Mode 93 Sample AppWidgetProviderInfo Object 93 The AppWidgetProvider Class 94 Application Manifest Entries 96 Summary 97 8 Application Design: Using MVC 99 Model 100 View 101 Controller 102 Working Asynchronously 104 AsyncTask 105 Summary 106

Description:
“A must read for all developers that want to begin serious Android development.”—Justin Anderson, Freelance Android Developer   “From start to finish, this book contains a variety of great tips and insight into the most important attributes of Android design. This book will definitely be re
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.