How do you locate a bug WITHOUT the emulator and the console?

Hi.
I'm new here and my English is not perfect but I'll try my best to explain my problem.
I'm trying to port J2ME games to various mobile phone devices. I've no problem fixing bugs on Nokia, Sony Ericsson, or any models that offer an emulator and a console window.
*** The problem is: In some case, The same build runs fine on Nokia/Sony emulator, but crash/freeze on LG phones.
(this is just an example, it's not only LG phones that have this problem though)
I believe it is possible to locate the bug by:
- use the 'try/catch' block and print the error message using something like
g.drawString(e.toString(),0,0,0);
where 'g' and 'e' is a Graphics and Exception objects.
But I wonder if there's a way to print 'everything that should be printed on the console', on the phones's display. So we don't need to manually put try/catch block.
ok, to sum up the question.
Question:
1. Is there a way to print 'everything that will normally appear on the console', on the phones's screen?
2. If no, then I'll need to try/catch the problem.
But how can you use try/catch and "drawString" everywhere in the code?, while the actual drawing will be done only in the "paint()" method?
I'm thinking of using 'getGraphics().drawString' when using try/catch outside the paint() method. but what's the point if the actual drawing will be done only in paint() method anyway...
Sorry if it's a stupid question. I just started learning Java programming 3 months ago, let alone J2ME. >_<
Thank you. =)
/bow

Hi Kakyoin,
What I found was helpfull is creating a method in the MIDlet where you can display messages. For instance:
    public void createFormScreen(Alert alert) {
        // Set up the initial screen for the MIDlet
        Form formScreen = new Form("Your MIDlet name");
        firstScreen.append("Welcome to your MIDlet");
        myChoice = new ChoiceGroup(null, ChoiceGroup.EXCLUSIVE);
        myChoice.append("Your first choice", null);
        myChoice.append("Your second choice", null);
        formScreen .append(myChoice);
        formScreen .addCommand(OKCOMMAND);
        formScreen .addCommand(EXITCOMMAND);
        formScreen .setCommandListener(this);
        theListener = this;
        if (alert == null) {
             theDisplay.setCurrent(formScreen Screen);
        } else {
            theDisplay.setCurrent(alert, formScreen);
    }So, from your constructor call the createFormScreen method, and your initial screen will be displayed.
When an allert situation occurs in an object, call createFormScreen in a method like:
     protected void displayMessage(String title, String msg) {
          // Display the error message
          Alert error = new Alert(title, msg, null,
                    AlertType.ERROR);
          error.setTimeout(Alert.FOREVER);
          myMIDlet.createStartScreen(error);
     }Now the error message will be displayed on the screen indefenitaly. Off course your object where the error occurred should have a reference to the MIDlet object. I hope this helps you.
Maik

Similar Messages

  • HT204053 how do you locate a iPac 2 Wi-fi and cell through iCloud?

    How do you locate an iPad 2 that has OS6.1 installed    and iCoud is running but not attached to another device?

    jakejanik,
    in this case, these are the data of interest:
    Model: MacBookPro8,2, BootROM MBP81.0047.B27, 4 processors, Intel Core i7, 2 GHz, 16 GB, SMC 1.69f4
    Memory Module: BANK 0/DIMM0, 8 GB, DDR3, 1600 MHz, 0x01BA, 0x202020202020202020202020202020202020
    Memory Module: BANK 1/DIMM0, 8 GB, DDR3, 1600 MHz, 0x01BA, 0x202020202020202020202020202020202020
    Your 15-inch Early 2011 MacBook Pro currently has 1600 MHz RAM installed, but it needs 1333 MHz RAM. Please replace your 1600 MHz RAM with 1333 MHz RAM.

  • HT2589 How do you create apple ID without the payment method?

    How do you create an apple ID without payment method?

    See this Discussion from the  More Like This section on the right...
    https://discussions.apple.com/message/18689003#18689003

  • How do you print from safari without the header and footer?

    I may be missing something but...
    When printing in Safari how do you remove the header and footer.  I am using PDF creator to save pages as PDF for things like online pay slips and want them to be 'clean'.
    Running Safari 5.1 on Windows Vista
    Thanks in advance for any help.
    Mark

    I may be missing something but...
    When printing in Safari how do you remove the header and footer.  I am using PDF creator to save pages as PDF for things like online pay slips and want them to be 'clean'.
    Running Safari 5.1 on Windows Vista
    Thanks in advance for any help.
    Mark

  • How do you reset an ipod without the buttons on it?

    i was on my ipod touch and then suddenly the screen just turned black and the loading sign has been on it for about an hour. do you know how to reset or anything? but if i press any button, nothing happens.

    See Here for
    Frozen or unresponsive iPod touch
    Try this First...
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
    Wait for the Apple logo to Appear...
    Usually takes about 15 - 20 Seconds... ( But can take Longer...)
    Release the Buttons...
    http://support.apple.com/kb/ht1430

  • When adding a PDF file to a New Message in Mail it does not show up as an icon link, the entire document appears. How can you attach a PDF without the entire document displaying itself?

    After scanning a document, I save the file in a PDF format. When attaching the PDF file to a New message it appears on the entire page instead of a PDF icon link that the recipient can click on to open. Why can't I get the PDF file to appear in a icon format? Thank you.

    Control mouse click the document and select View as icon.

  • How do you locate lost/stolen i pod without an i pod locating app?

    How do you locate lost/stolen i pod without an i pod locating app?

    im asking if someone stole the ipod can apple see if its been any recent activity (has anyone been using it?) by Apple looking throughmy Ipod's serial number?

  • How do you Remove a photo from the camera roll album without deleting from other albums

    How do you Remove a photo from the camera roll album without deleting from other albums

    If it was originally on the camera roll try this: take another unimportant photo for test purposes, copy it to any special folder you have created within Photos, connect your iPad to your computer, locate it as any other external device, and most likely that Photos folder will be the only thing that will show up, locate the photo, delete it and then sync your iPad.
    If the test photo is gone from the camera roll but still in another folder within the app then you know that the system works so go ahead with the process. I understand that there are other photo apps which might let you achieve your goal much quicker.
    Hope thi helps.

  • How do you get Photos to recognize the "old" iPhoto Library on an external drive without it copying it to the internal drive on the computer which is low in HD space?

    How do you get Photos to recognize the “old” iPhoto Library on an external drive without it copying it to the internal drive on the computer which is low in HD space?

    Launch Photos while holding down the alt/options key.
    This will show the Library Chooser panel. Select the library on the external drive. Photos will create a Photos Library on the same drive.
    Photos may not be able to open the library, however, if your external drive has an incompatible file system. It needs to be formatted MacOS Extended (Journaled) and locally mounted, not a remotely mounted volume, as described here:  Format external drives to Mac OS Extended before using with Aperture

  • How do you download multiple apps without having to enter the password each time

    How do you download multiple apps without having to enter the password each time

    You don't, this is a security measure which can't be changed, however, if you purchase another App within 15 minutes your password should not be required.

  • How can you search this forum without searching all the other forums

    how can you search this forum without searching all the other forums at the same time which is a big fat waste of time.

    Follow this tip to create a bookmark to a search page that searches only the forum you want or...
    Browse with Firefox and enable this Greasemonkey script, which forces all searches from a sub-forum to be local.

  • How do you find your iPhone without downloading iCloud or having the find my iphone app???

    How do you find your iPhone without downloading the find my iphone app, or having your iCloud app/ ID setup????

    I HAVE THE SAME **** ?????'S & THE SAY SPEND $800.00 TO BUY ANOTHER IPHONE???? *** WHY CANT WE GET ANOTHER IPHONE FROM SPRINT AFTER A 2YEAR CONTRACT U STILL HAVE TO PAY PER AGREEMENT WHICH MEANS A MONTHLY BILL OF $100 4 2 YRS $2400 DOLLARS ($100X24MONTHS=$2400) + WHAT U PAID 4 THE IPHONE $150 SIGN UP 4 THE CONTRACT?

  • HT2513 How do you set up reminders if the New Reminders tab is not located under file?

    How do you set up reminders if the New Reminders tab is not located under file? This is a iCal question.

    You set up reminders in the Reminders app.

  • How do you add a page without messing up all the images below.?

    How do you add a page without messing up all the images below? 
    I try the pages ->add a page beak but it messing up with all the images below. Examples : I want to insert a page between page 1 and 2. My images doesn't follow my text. All the images stay in place and all the text bump 1 page.  Pretty frustrating!

    What version of Pages?
    Peter

  • HT1498 How do you return a movie without being charged, ie. if you rented it in the wrong language.

    How do you return a movie without being charged, ie. if you rented it in the wrong language.
    How do you return an App if you are not happy with how it works.

    Purchases and rentals are final acording to Apples TOS.
    You can try and get a refund by contacting support by clicking the link below.
    Contact Support

Maybe you are looking for