High Performance Android Apps

Book description

Unique and clever ideas are important when building a hot-selling Android app, but the real drivers for success are speed, efficiency, and power management. With this practical guide, you’ll learn the major performance issues confronting Android app developers, and the tools you need to diagnose problems early.

Customers are finally realizing that apps have a major role in the performance of their Android devices. Author Doug Sillars not only shows you how to use Android-specific testing tools from companies including Google, Qualcomm, and AT&T, but also helps you explore potential remedies. You’ll discover ways to build apps that run well on all 19,000 Android device types in use.

  • Understand how performance issues affect app sales and retention
  • Build an Android device lab to maximize UI, functional, and performance testing
  • Improve the way your app interacts with device hardware
  • Optimize your UI for fast rendering, scrolling, and animations
  • Track down memory leaks and CPU issues that affect performance
  • Upgrade communications with the server, and learn how your app performs on slower networks
  • Apply Real User Monitoring (RUM) to ensure that every device is delivering the optimal user experience

Publisher resources

View/Submit Errata

Table of contents

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

Product information

  • Title: High Performance Android Apps
  • Author(s): Doug Sillars
  • Release date: October 2015
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781491912515