开发者

Using Android Debugger - is this the correct way of interpretating potential error?

Today I was reading up on debugging and I came across a post in stackoverflow saying that the debugger itself in eclipse does not tell alot of useful information and most information lies in the LogCat ?

I've done a screenshot of the LogCat output and saw a colorful output which is dazzling. I went ahead with the most obvious danger color (red) and saw that at the end of the output it says error caused by NullpointerE开发者_开发问答xception in fillData() and onCreate().

My question is:

  1. Is that an indication of the bug in my code (as mine crashes at startup) ? Is the bug Nullpointerexception ? Is this the right way of finding out immediate bugs in code ?

  2. Is the red color output of Logcat the main portion to zoom in to look for bug problems?

Thank you ! I think this post wud be useful for many noob android coders as there isn't many resources out there teaching how to use the debugger properly :(


To view all application logs you should check "LogCat" in "DDMS".
In LogCat you can filter logs by Log Level (V=Verbose, D=Debug, I=Info, W=Warning and E=Error).

You can check application crashes by filtering by Error - this way you can check where the problem is happening (by viewing the stacktrace).

However, if you want to perform step by step debug, add breakpoints and run the application in debug mode. Then open perspective "Debug" and you'll be able to debug line by line.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜