Foreword
Preface
1. Introduction to Android Performance
Performance Matters to Your Users
Ecommerce and Performance
Beyond Ecommerce Sales
Performance Infrastructure Savings
The Ultimate Performance Fail: Outages
Performance as a Rolling Outage
Consumer Reaction to Performance Bugs
Smartphone Battery Life: The Canary in the Coal Mine
Testing Your App for Performance Issues
Synthetic Testing
Real User Monitoring (RUM)
Conclusion
2. Building an Android Device Lab
What Devices Are Your Customers Using?
Device Spec Breakdown
Screen
SDK Version
CPU/Memory and Storage
What Networks Are Your Customers Using?
Your Devices Are Not Your Customers' Devices
Testing
Building Your Device Lab
You Want $X,000 for Devices?
So What Devices Should I Pick?
Beyond Phones
Android Open Source Project Devices
Other Options
Additional Considerations
My Device Lab
Conclusion
3. Hardware Performance and Battery Life
Android Hardware Features
Less Is More
What Causes Battery Drain
Android Power Profile
Screen
Radios
CPU
Additional Sensors
Get to Sleep!
Wakelocks and Alarms
Doze Framework
Basic Battery Drain Analysis
App-Specific Battery Drain
Coupling Battery Data with Data Usage
App Standby
Advanced Battery Monitoring
batterystats
Battery Historian
Battery Historian 2.0
JobScheduler
Conclusion
4. Screen and UI Performance
UI Performance Benchmarks
Jank
UI and Rendering Performance Updates in Android
Building Views
Hierarchy Viewer
Asset Reduction
Overdrawing the Screen
Testing Overdraw
Overdraw in Hierarchy Viewer
Overdraw and KitKat (Overdraw Avoidance)
Analyzing For Jank (Profiling GPU Render)
GPU Rendering in Android Marshmallow
Beyond Jank (Skipped Frames)
Systrace
Systrace Screen Painting
Systrace and CPU Usage Blocking Render
Systrace Update--I/O 2015
Vendor-Specific Tools
Perceived Performance
Spinners: The Good and the Bad
Animations to Mask Load Times
The White Lie of Instant Updates
Tips to Improve Perceived Performance
Conclusion
5. Memory Performance
Android Memory: How It Works
Shared Versus Private Memory
Dirty Versus Clean Memory
Memory Cleanup (Garbage Collection)
Figuring Out How Much Memory Your App Uses
Procstats
Android Memory Warnings
Memory Management/Leaks in Java
Tools for Tracking Memory Leaks
Heap Dump
Allocation Tracker
Adding a Memory Leak
Deeper Heap Analysis: MAT and LeakCanary
MAT Eclipse Memory Analyzer Tool
LeakCanary
Conclusion
6. CPU and CPU Performance
Measuring CPU Usage
Systrace for CPU Analysis
Traceview (Legacy Monitor DDMS tool)
Traceview (Android Studio)
Other Profiling Tools
Conclusion
7. Network Performance
Wi-Fi versus Cellular Radios
Wi-Fi
Cellular
RRC State Machine
Testing Tools
Wireshark
Fiddler
MITMProxy
AT&T Application Resource Optimizer
Hybrid Apps and WebPageTest.org
Network Optimizations for Android
File Optimizations
Text File Minification (Souders: Minify JavaScript)
Images
File Caching
Beyond Files
Grouping Connections
Detecting Radio Usage in Your App
All Good Things Must Come to An End: Closing Connections
Regular Repeated Pings
Security in Networking (HTTP versus HTTPS)
Worldwide Cellular Coverage
CDNs
Testing Your App on Slow Networks
Emulating Slow Networks Without Breaking the Bank
Building Network-Aware Apps
Accounting for Latency
Last-Mile Latency
"Other" Radios
GPS
Bluetooth
Conclusion
8. Real User Monitoring
Enabling RUM Tools
RUM Analytics: Sample App
Crashing
Examining a Crashlytics Crash Report
Usage
Real-Time Information
Big Data to the Rescue?
RUM SDK Performance
Conclusion
A. Organizational Performance
Index