Android Development Patterns: Best Prac... | WHSmith Books
Android Development Patterns: Best Practices for Professional Developers

Android Development Patterns: Best Practices for Professional Developers

By: Phil Dutson (author)Paperback

Up to 2 WeeksUsually despatched within 2 weeks


"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 required reading for any of our future Android engineers."-Cameron Banga, Cofounder, 9magnets, LLC There's a downside to Android's amazing openness and versatility: it's easy for developers to write code that's inefficient, unreliable, insecure, or hard to maintain. In Android Development Patterns, enterprise Android developer Phil Dutson helps you leverage Android 5.0+'s amazing power without falling victim to those pitfalls. Dutson presents today's most comprehensive set of patterns and procedures for building optimized, robust apps with Android 5.0+. First, Dutson guides you through establishing a highly efficient development environment and workflow, and testing your app to ensure that your code works just as you expect. Then, he walks through the modern best practices for structuring apps, using widgets and components, and working with views. You learn how to build apps that are easy to manage and update, deliver accurate and up-to-date information without wasting precious battery power, and take advantage of new hardware, such as Android Wear and Android TV. Dutson concludes by presenting powerful strategies for optimizing your apps and packaging them for distribution. Coverage includes Using testing to build more trustworthy, dependable, maintainable apps Understanding subtle but critical differences between Android and traditional Java programming Building consistent, modern user interfaces with views and layouts Leveraging the proven MVC pattern to cleanly organize logic Creating rich visual experiences with 3D graphics, animation, and media Simplifying capture and use of location data with the new Locations API Integrating optional hardware, such as Bluetooth, NFC, or USB Building better apps with Google Play Services Creating Android Wear notifications and apps Tuning and improving apps with Google Analytics Designing Android TV apps for the "ten foot view" |

About Author

Phil Dutson is a Solution Architect over client-side and mobile implementation for one of the world's largest e-commerce retailers in fitness equipment. He has been collecting and developing for mobile devices since he got his hands on a US Robotics Pilot 5000. He is the author of Sams Teach Yourself jQuery Mobile in 24 Hours (Sams, July 2012), jQuery, jQuery UI, and jQuery Mobile: Recipes and Examples (Pearson, November 2012), Android Developer's Cookbook, Second Edition (Pearson, July 2013), and Responsive Mobile Design (Addison-Wesley Professional, September 2014).


Preface xiv 1 Development Tools 1 Android Studio 1 Installing Android Studio 2 Using Android Studio 4 Starting a New Project 6Standalone SDK Tools 9Android Device Emulation 10 Android Virtual Device 11 GenyMotion 12 Xamarin Android Player 13Version-Control Systems 14 Subversion 14 Git 14 Mercurial 15Summary 15 2 Testing and Debugging 17Unit Testing 17Integration Testing 20Debugging 25 Profiling 25 Tracing 27 Messaging 29Summary 32 3 Application Structure 33Manifests 34Java 36Res (Resources) 37 Drawable 37 Layout 39 Menu 39 Values 40 Other Resources 41Gradle 41Summary 42 4 Components 45Intents 45 Intent Filters 46 Broadcast Receivers 47Activities 48 Creating an Activity 48 Activity Lifecycle 49Fragments 52 Creating a Fragment 52 Communicating with Fragments 55 Loaders 56Summary 58 5 Views 59The 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 68Creating a Custom View 68Summary 70 6 Layout 71Layout Basics 71 Layout Measurements 72 Layout Coordinates 73Layout Containers 74 Linear Layout 74 Relative Layout 76 Table Layout 79 Frame Layout 80 WebView 82Summary 83 7 App Widgets 85App Widget Layouts 86The AppWidgetProviderInfo Object 88 App Widget Sizing 89 Update Frequency 90 Preview Image 90 Widget Category 92 Widget Category Layout 92 Resizable Mode 93 Sample AppWidgetProviderInfo Object 93The AppWidgetProvider Class 94Application Manifest Entries 96Summary 97 8 Application Design: Using MVC 99Model 100View 101Controller 102Working Asynchronously 104 AsyncTask 105Summary 106 9 Drawing and Animation 107Graphics 107 Bitmaps 107 NinePatch 109 Drawables 111 OpenGL ES 114Animation 117 View Animation 117 Property Animation 118 Drawable Animation 122 Transition Framework 123Summary 125 10 Networking 127Accessing the Internet 127 Network Detection 127 Using an HTTP Client 129Parsing XML 131Handling Network Operations Asynchronously 133Volley 135Summary 138 11 Working with Location Data 139Permissions 139Google Play Services Locations API 148Summary 153 12 Multimedia 155Working with Audio 155 Audio Playback 156 Audio Recording 159Working with Video 161 Video Playback 162Summary 165 13 Optional Hardware APIs 167Bluetooth 167 Enabling Bluetooth 168 Discovering Devices with Bluetooth 169 Connecting via Bluetooth Classic 171 Communicating with BLE 173Near Field Communication 176 ACTION NDEF DISCOVERED 177 ACTION TECH DISCOVERED 178 ACTION TAG DISCOVERED 179Device Sensors 181 Detecting the Available Sensors 182 Reading Sensor Data 183Summary 185 14 Managing Account Data 187Getting Accounts 187Android Backup Service 188Using Google Drive Android API 191Using Google Play Games Services 195 Working with Saved Games 196Summary 199 15 Google Play Services 201Adding Google Play Services 201Using Google API Client 203Google Fit 207 Enable API and Authentication 207 App Configuration and Connection 208Nearby Messages API 209 Enabling Nearby Messages 209 Sending and Receiving Messages 210Summary 214 16 Android Wear 217Android Wear Basics 217Screen Considerations 218Debugging 221 Connecting to an Emulator 221 Connecting to a Wear Device 222Communicating with Android Wear 224 Notifications 224 Sending Data 226Summary 228 17 Google Analytics 229Adding Google Analytics 229Google Analytics Basics 232 Events 233 Goals 234 Ecommerce 235 Custom Timings 235 Custom Dimensions 236 Custom Metrics 236Summary 237 18 Optimization 239Application Optimization 239 Application First 239 Application Logging 241 Application Configuration 242Memory Management 243 Garbage Collection Monitoring 245 Checking Memory Usage 245Performance 247 Working with Objects 247 Static Methods and Variables 248 Enhanced for Loops 248 float, double, and int 249 Optimized Data Containers 249Summary 249 19 Android TV 251The Big Picture 251 Ten-Foot View 252 TV Capabilities 254 Text, Color, and Bitmaps 255Building an App 258Emulation and Testing 261Summary 263 20 Application Deployment 265Preparing for Deployment 265Production Checklist 266 Certificate Keys 266 Contact Email 266 App Website 267 External Services or Servers 267 Application Icon 267 Licensing 268 Appropriate Package Name 268 Verifying Permissions and Requirements 269 Log and Debug Removal 270 Removal of Excess Unused Assets 270Preparing for Google Play 270 Application Screenshots 271 Promo Video 271 High-Res Icon 271 Feature Graphic 272 Promo Graphic 272 Banner for Android TV 272 Getting Paid 272APK Generation 273Summary 274 Index 275

Product Details

  • ISBN13: 9780133923681
  • Format: Paperback
  • Number Of Pages: 320
  • ID: 9780133923681
  • weight: 498
  • ISBN10: 0133923681

Delivery Information

  • Saver Delivery: Yes
  • 1st Class Delivery: Yes
  • Courier Delivery: Yes
  • Store Delivery: Yes

Prices are for internet purchases only. Prices and availability in WHSmith Stores may vary significantly