SKIP THE SHIPPING
Use code NOSHIP during checkout to save 40% on eligible eBooks, now through January 5. Shop now.
Register your product to gain access to bonus material or receive a coupon.
This eBook includes the following formats, accessible from your Account page after purchase:
EPUB The open industry format known for its reflowable content and usability on supported mobile devices.
PDF The popular standard, used most often with the free Acrobat® Reader® software.
This eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.
“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
informit.com/aw | https://github.com/dutsonpa/adp-files
Download the sample pages (includes Chapter 5 and Index)
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
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
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
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
6