Version First Edition
Platform Android 12
Language Kotlin 1.6
Editor Android Studio Chipmunk (2021.2.1)

Debugging is one of the most important steps in app development. Android Studio contains several tools which can help you out in stabilizing and optimizing your app.

In this book, you’ll learn to use Android debugging tools to make your app optimized and bug-free through step-by-step tutorials.

Before You Begin

This section tells you a few things you need to know before you get started, such as what you’ll need for hardware and software, where to find the project files for this book, and more.

i

iii

iv

v

Section I: Debugging Basics

Debugging is the core of every development process. This term represents steps for detecting and fixing issues that can cause unexpected behavior in your app.

In the first chapter, you'll prepare your debugging environment by learning to use some Android Studio debugging tools.

1

In this chapter, you'll learn all about breakpoints and how to navigate your suspended code so that you can debug and evaluate it.

2

This chapter will teach you how to use the Logcat window in Android Studio, how to customize and filter it and how it can help you spot and fix bugs. You'll also learn the best practices for sending custom logs in app development.

3

This chapter will dive deep into using the stack trace to understand what your app is doing, the tools you can use to navigate it and how to fix bugs.

4

In this chapter, you'll learn how to observe and augment your variables when debugging an app to help you locate and fix problems and save you time when developing new logic.

5

In this chapter, you'll learn how to use the Layout Inspector to view, analyze and improve your Android views.

6

This chapter will teach you how to explore, debug and modify queries from the Database in your Android app using Database Inspector.

7

This chapter will teach you how to debug background tasks or services, trace long-running operations and extract underlying details.

8

Section II: The Android Profiler

Now that you got a feeling of how to manage the debugging process, you’ll start learning more complex tools. In this section, you’ll meet a really powerful set of tools called Android Profiler. This tool package provides gear for examining app performance in depth.

In this chapter, you'll learn how to harness all the power the Android Studio CPU Profiler offers!

9

This chapter will teach you to look into memory footprints, identify memory leaks and optimize your app's memory usage.

10

This chapter will teach you how to debug network requests sent from the app, dissect details and prevent unnecessary network calls.

11

This chapter will teach how to use the Energy Profiler to find resource-hungry operations and optimizing for minimal resource consumption.

12

Meet the team

Contributors

Who is this book for

This book is for intermediate Android developers who already know the basics of Android development but want to extend their knowledge of debugging steps and Android Studio debugging tools.

Concepts covered in this book

  • Android Debug Bridge
  • Wireless debugging
  • Breakpoints
  • Logcat
  • Stack traces
  • Evaluating Code
  • Watches
  • Layout Inspector
  • Debugging databases
  • Debugging background processes
  • CPU Profiler
  • Memory Profiler
  • Network Profiler
  • Energy Profiler

Reviews

Version history

First Edition · Android 12, Kotlin 1.6, Android Studio Chipmunk (2021.2.1)

v1.0 · Aug 17 2022 · Zahidur Rahman Faisal, Vincenzo Guzzi & Zac Lippard
See book details
Pro

Android Debugging by Tutorials

By Zahidur Rahman Faisal, Vincenzo Guzzi and Zac Lippard

Learn to use Android debugging tools to make your app optimized and bug-free.

Read for Free with the Pro subscription* * Includes this and all other books in our online library See all benefits
Buy Individually $59.99* *Includes access to all of our online reading features.
See buying options
Hide buying options

All videos. All books.
One low price.

A raywenderlich.com subscription is the best way to learn and master mobile development — plans start at just $19.99/month!

Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.