It may not be supported in CLDC but you can get the stack trace from the
Throwable object. I do this in regular java to create custom stack traces.
(I don't do much CLDC dev just CLDC testing).
Here's an excerpt from a windows program I am working on for fun.
Assume err is an Exception that extends Throwable.
CR is a windows Carriage return (or unix or mac..whatever I feel like)
StackTraceElement elements = err.getStackTrace();
String output =err.getClass()+":"+err.getMessage()+CR;
output += elements[erri].getClassName()+":"+elements[erri].getLineNumber() + CR;
As for debugging with applis... you can print debug data straight on top of your app to the screen.
That's the standard method.... (usually before the error occurs and often checking the memory remaining).
Sam Joseph wrote:
> Hi Keitat-l'ers,
> So I'm working on a unit test package for Doja phones and I'm trying to
> get the results of the unit-tests sent back over the wire. I've managed
> to do this on the emulator at least, but now I'm trying to send back the
> output of the printStackTrace() operations - that most useful of
> debugging information.
> However it seems that CLDC 1.0 at least is of no help here since the
> printStackTrace() operations cannot point anywhere except System.err and
> System.err is final. CLDC 1.1 looks no different.
> I guess that means there is no way to redirect that output at all ...
> Any ideas on ways round this?
> Many thanks in advance.
> CHEERS> SAM
> This mail was sent to address paul_at_thetamusic.com
> Need archives? How to unsubscribe? http://www.appelsiini.net/keitai-l/
Paul B. Lester
personal homepage: http://pbl1.tripod.com/
personal EMAIL: pbl1_at_cornell.edu
Received on Fri Jan 7 05:32:21 2005