×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    40

    MIDlet works on Nokia but not on Sony Ericsson

    Hello,

    i created a MIDlet which works on my N95 an other Nokia phones, but does not work on Sony Ericsson Phones, although they have MIDP-2.0 and CLDC-1.1. On some Sony Ericssons it can be installed, but can not be started, on other Sony Ericssons it can't be installed...

    The MIDlet uses Canvas, but no other important functions.

    What can be the reason, that it does not work on the SE phones?

    Thanks

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: MIDlet works on Nokia but not on Sony Ericsson

    Can you say more about the problem? What happens when you try to install it, or run it?

    What is the size of the JAR file?

    Graham.

  3. #3
    Registered User
    Join Date
    Apr 2009
    Posts
    40

    Re: MIDlet works on Nokia but not on Sony Ericsson

    Hello,
    the size of the .jar File is 85kb.
    I have a friend here, he has a SE M600i, he can install the MIDlet, but if he starts it, the JAVA Logo appears, but then nothing happens. On a K550i i can't be installed, if you install it, there i an error: Fehler in der Anwendung, that means Error in the application.

    The Midlet starts an does first do nothing else than show a blue background, painted with canvas, and an image, created on that background, with canvas, too.

  4. #4
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: MIDlet works on Nokia but not on Sony Ericsson

    hhmm.. maybe some exceptions are thrown ? do you have try-catch around the code that might throw exceptions ? as in : do you have used any exception-handling ?
    personally I've had some problems with internet-connections with SE and Samsung but most of the time Canvas stuff (especially simple stuff) actually ran pretty fine...
    is there maybe some kind of SE emulator around to try it on and see if exceptions/errors arise ?

  5. #5
    Registered User
    Join Date
    Apr 2009
    Posts
    40

    Re: MIDlet works on Nokia but not on Sony Ericsson

    Hmm.. I am sure that i catch every error, for example when i create the image logo on startup... i try to make it more simple to find out, why it doesnt start on SE phones. If I found any solution i will report it here

  6. #6
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: MIDlet works on Nokia but not on Sony Ericsson

    that logo you are mentioning how big is it ? might it be some kind of outofmemory error which doesnt get handled well by the underlying OS ?

  7. #7
    Registered User
    Join Date
    Apr 2009
    Posts
    40

    Re: MIDlet works on Nokia but not on Sony Ericsson

    This code is for the startup:

    Code:
        //Standardkonstruktor
        public Carfinder() {
            try {
                imageMenue = Image.createImage("/Menu.png");
                imageLogo = Image.createImage("/Logo.png");
            } catch (Exception e) {
                e.printStackTrace();
                imageMenue = null;
                imageLogo = null;
            }
            ck = new CanvasKlasse();
        }
    
    
        //Starten der Applikation
        public void startApp() {
            display = Display.getDisplay(this);
            grafikCode = 0;
            ck.repaint();
            display.setCurrent(ck);
            try {
                Thread.sleep(2000);
            } catch (InterruptedException ie) {
                ie.printStackTrace();
            }
            mainScreen();
        }
    
        public void mainScreen() {
            scrollX = 0;
            scrollY = 0;
            display = Display.getDisplay(this);
            grafikCode = 1;
            ck.repaint();
            ck.removeCommand(start);
            ck.removeCommand(zurueckMenue);
            ck.removeCommand(zurueckStart);
            ck.removeCommand(ja);
            ck.removeCommand(nein);
            ck.removeCommand(browser);
            ck.addCommand(ende);
            ck.addCommand(car2go);
            ck.addCommand(hilfe);
            ck.addCommand(info);
            ck.addCommand(test);
            ck.addCommand(webapp);
            ck.setCommandListener(this);
            display.setCurrent(ck);
        }
    Then there is the Canvas class, where it is painted...

  8. #8
    Registered User
    Join Date
    Apr 2009
    Posts
    40

    Re: MIDlet works on Nokia but not on Sony Ericsson

    Here the size of the 2 created images:

    Menu.png = 46kb
    Logo = 8kb

    Can this be the problem?

  9. #9
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: MIDlet works on Nokia but not on Sony Ericsson

    M600 is a Symbian UIQ device (think of it like Sony's equivalent of Series 60), while the K550 is more like Sony's equivalent of Series 40. So it's not surprising that the two behave differently.

    You say on the K550, you get "error in the application" when you install it (you do not have a chance to try starting the application)? How are you installing? OTA, Bluetooth, etc.? Do you install both JAD and JAR, or just JAR?

    Sony's emulators are usually just the Sun WTK emu reskinned. However, most Sony devices support on-device debugging, so it is well worth downloading the Sony SDK from the Sony Ericsson Developer World site.

    Graham.

  10. #10
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: MIDlet works on Nokia but not on Sony Ericsson

    Oh, you should certainly avoid calling sleep() in startApp()!

    Event methods that are called by the device itself (like startApp(), keyPressed(), paint() and so on) should return as quickly as possible.

    You also have many calls to repaint() and setCurrent() for the same Displayable object. There is no point repaint()ing a Canvas that is not yet current. It will automatically repaint() when it becomes current.

    Avoid doing anything in the MIDlet constructor.

    Graham.

  11. #11
    Registered User
    Join Date
    Apr 2009
    Posts
    40

    Re: MIDlet works on Nokia but not on Sony Ericsson

    On K550i there is no chance to start it. I sent him the jar without jad over BT.

    I will try the Sony SDK, but later I am in school...

  12. #12
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: MIDlet works on Nokia but not on Sony Ericsson

    that 46 kb png whats its resolution in pixels ?

  13. #13
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: MIDlet works on Nokia but not on Sony Ericsson

    Can you post the contents of your JAR's MANIFEST file?

  14. #14
    Registered User
    Join Date
    Apr 2009
    Posts
    40

    Re: MIDlet works on Nokia but not on Sony Ericsson

    Can you post the contents of your JAR's MANIFEST file?
    Manifest File:

    Code:
    MIDlet-1: Carfinder,/Icon.png,SymbianPart.Carfinder
    MIDlet-Vendor: Vendor
    MIDlet-Name: Carfinder
    MIDlet-Version: 1.0
    MicroEdition-Configuration: CLDC-1.1
    MicroEdition-Profile: MIDP-2.0

    that 46 kb png whats its resolution in pixels ?
    200x200 pixels.

    I will try later without creating images, then I know if the problem is made by the images.
    Now I cant try, cause I have no SE phone here

    Oh, you should certainly avoid calling sleep() in startApp()!
    OK i'll will remove it...

    Avoid doing anything in the MIDlet constructor.
    Why? I saw many examples in the www, and most of them put code like this in the standardconstr...


    Thanks for your help and attention everybody, this is my first j2me project, i was helped a lot in this forum, next week i must demonstrate it to my prof at the university... therefore i wanted to test it on other phones...

  15. #15
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: MIDlet works on Nokia but not on Sony Ericsson

    Quote Originally Posted by carsamba55 View Post
    Manifest File:

    Code:
    MIDlet-1: Carfinder,/Icon.png,SymbianPart.Carfinder
    MIDlet-Vendor: Vendor
    MIDlet-Name: Carfinder
    MIDlet-Version: 1.0
    MicroEdition-Configuration: CLDC-1.1
    MicroEdition-Profile: MIDP-2.0
    OK... two things:

    1. I suggest you change the version number to 1.0.0 - this is the prefered format.

    2. Is your icon image file called "Icon.png", or "icon.png"? The name needs to match precisely.

    Quote Originally Posted by carsamba55 View Post
    Why? I saw many examples in the www, and most of them put code like this in the standardconstr...
    Two reasons:

    1. Again, this is a method invoked by the device, and should return quickly. In particular, avoid anything that is time consuming, such as loading resources.

    2. This is the application object, and it may be in an uncertain state until it has finished constructing. You are likely to get different behaviours on different devices. Display.getDisplay(midlet) might not work correctly, for example, because the midlet is not completely constructed yet.

    Also:

    Are you image file named "Logo.png" and "Menu.png", or "logo.png" and "menu.png"?

    When you load these images, you handle any exceptions by setting the variables to null. This is a bad plan. How do you handle the situation where these variables are null in, say, the paint() method? Probably, you just get a NullPointerException thrown later (which maybe you are also catching and ignoring). Exceptions are there to help you track problems. Writing catch{} blocks that just swallow exceptions and allow the program to carry on usually results in bugs that are hard to trace.

    Graham.

Page 1 of 2 12 LastLast

Similar Threads

  1. ###Upgrading Firmware###
    By zahid44 in forum General Development Questions
    Replies: 27
    Last Post: 2008-10-21, 07:17

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •