How to debug Android?

Well, that’s why I finally got enough working parts in my application, and now it just doesn’t want to do anything. I understand how to use logcat, but more on that.

The main problem at the moment is that I get an error

Activity timeout for Record history and then my package

I need to learn how to better debug. Plus, if anyone can suggest things I should do for this mistake, please let me know. I think this is due to the interaction with the database.

Greetings

EDIT:

What IDEs do you use, if any? Eclipse with an Android tool has moderately good debugging tools; set a breakpoint and debug.

I use Eclipse. And I know breakpoints, but not their actual use. Where can I install them for this error?

I use PHP, where errors point to a specific line that you can look at, is there a way to do this in Eclipse?

+3
source share
3 answers

In Eclipse, if you right-click on the field next to your code - a convenient place to run is probably in your method onCreate- you can choose Toggle Breakpoint. This will set a breakpoint at this location.

Now in Eclipse, select Run-> Debug As-> Android Application.

This will launch your application in the emulator and your application with a stop at the breakpoint. At this point, you can step through a line of code using F6, I believe.

, , http://www.ibm.com/developerworks/library/os-ecbug/, .

+3

Max... try catch, . , :

String test= null;
try {
 test.length();
}
catch (Exception e) {
    Log.d(TAG,"test",e);
}

LogCat test, java.lang.NullPointerException blah, blah, blah

Log.d, DEBUG, , DEBUG :

this:MyApp e:NullPointerException

BUT this does not look like your application throws an exception, rather, this time is turned off when the database is called. I would stop the call in the database and see if the timeout has disappeared. Then slowly add the code back until it expires.

Jal

0
source

Source: https://habr.com/ru/post/1792593/


All Articles