Member-only story

Debugging your Code in Android Studio.

Jayant Kumar🇮🇳
6 min readSep 20, 2024

--

Photo by Nubelson Fernandes on Unsplash

In this article we will see how to debug the code in android studio. Debugging means to find the errors or check something in the code and fix it . When we add the debugger in our code , we can easily find the errors.

There are various ways to debug the code in Android Studio

1). Logcat Debugging

The very first and simple way to debug the code is to use Logcat . When you add the logs in the code , we can easily see the message in the Logcat .

Logcat

As you can see in the above image , when you click on the Logcat of the bottom left side bar , this screen will open where you can see the logs.

.doOnSuccess {
_deleteItemEventFlow.emit(
ApiState.Success(it ?: "{}")
)
Log.d(tag = "main", msg = "Hello how are you?")
}

As you can see in the above code we put a Logger with Log.d() .

  • Log.d — here d represent debug , that is to debug the code.
  • tag — you can write anything here, that is used to identity the source of error ( through this tag we can search the message).

--

--

Jayant Kumar🇮🇳
Jayant Kumar🇮🇳

Written by Jayant Kumar🇮🇳

Hello My name is Jayant Kumar, I am a software Engineer , specialist in Mobile Development (Android , IOS , Flutter , React Native and Ionic) from India 🇮🇳

Responses (1)