I thought I would share a piece of code I used recently in debugging an application on a specific device. It did help solve the problem, but it wasn't pretty. I'm sure it could be more robust, but it worked for me. Just a note, I'm big on arrays and not using vectors for anything when I code j2me. The device I was debugging on was already close to memory limits so this code uses arrays. The screen was very small as well and 5 lines was all I could fit.

I have a similar setup with some addition.On top of displaying the errors on screen, I can also save them in the RMS (and use a second MIDlet in the Suite to read those logs), or send them to a server with will save the data in a database. A few final static booleans control which of the logging methods will be activated from a general purpose raiseError() method:

publicstaticvoidraiseError(Stringerror) {if (LOG_CONSOLE ) {System.out.println(error); }if (LOG_UI) {// something similar to what you did }if (LOG_RMS) {// save the error in the an RMS record }if (LOG_NET) {// send the error to a remote logging server }}

Since the conditions are final variables, the compiler/obfuscator will remove any unused methods from the final application.

I have a similar system linked to my static Util.log function using an additonal debug midlet in my suite - very very handy. You've given me some ideas as to the remote logging which could be very useful.

Could it be feasible to send any logs via bluetooth (not having implemented any bluetooth applications so far)?

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org