Member-only story
Debugging your Code in Android Studio.
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
.
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
— hered
representdebug
, that is to debug the code.tag
— you can write anything here, that is used to identity the source of error ( through thistag
we can search the message).