Sunday, January 4, 2009

Stdout on the Android DEV-1

Pro-tip: Always have a terminal running and showing the output of adb logcat. That's where all your System.out.println()s will show up as well as stack dumps of your fatal exceptions.

Not that I ever get fatal exceptions, that is.

Second protip: The ID being assigned in the layout MUST be the android namespace id (android:id), NOT the XML id. Doing the latter will cause your calls to findViewById() to return null. However, the ID will be placed into the R file regardless. Which can be confusing.

No comments:

Post a Comment