Game Development Reference
In-Depth Information
ï?®
The Console view, also present in the Java perspective, prints out messages
from the ADT plug-in, telling us what it is doing.
ï?®
The Task List view (the tab with the label “Tasks� next to the Console view is
the same as in the Java perspective. We usually have no need for it, you can
savely close it.
ï?®
The LogCat view will be one of your best friends on your journey. This
view shows you logging output from the emulator/device on which your
application is running. The logging output comes from system components,
other applications, and your own application. The LogCat view will show
you a stack trace when your application crashes and will also allow you to
output your own logging messages at runtime. We'll take a closer look at
LogCat in the next section.
ï?®
The Outline view, also present in the Java perspective, is not very useful in
the Debug perspective. You will usually be concerned with breakpoints and
variables, and the current line on which the program is suspended while
debugging. We often remove the Outline view from the Debug perspective to
leave more space for the other views.
ï?®
The Variables view is especially useful for debugging purposes. When the
debugger hits a breakpoint, you will be able to inspect and modify the
variables in the current scope of the program.
ï?®
The Breakpoints view shows a list of breakpoints you've set so far.
If you are curious, you've probably already clicked the button in the running application to see
how the debugger reacts. It will stop at line 23, as we instructed it by setting a breakpoint there.
You will also have noticed that the Variables view now shows the variables in the current scope,
which consist of the activity itself ( this ) and the parameter of the method ( v ). You can drill down
further into the variables by expanding them.
The Debug view shows you the stack trace of the current stack down to the method you are in
currently. Note that you might have multiple threads running and can pause them at any time in
the Debug view.
Finally, notice that the line where we set the breakpoint is highlighted, indicating the position in
the code where the program is currently paused.
You can instruct the debugger to execute the current statement (by pressing F6), step into
any methods that get called in the current method (by pressing F5), or continue the program
execution normally (by pressing F8). Alternatively, you can use the items on the Run menu to
achieve the same. In addition, notice that there are more stepping options than the ones we've
just mentioned. As with everything, we suggest you experiment to see what works for you and
what doesn't.
Note Curiosity is a building block for successfully developing Android games. You have to get
intimate with your development environment to get the most out of it. A book of this scope can't
possibly explain all the nitty-gritty details of Eclipse, so we urge you to experiment.
 
Search WWH ::




Custom Search