| Reply | « Previous Thread | Next Thread » |
|
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 |
| carsamba55 |
| View Public Profile |
| Find all posts by carsamba55 |
|
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. |
| grahamhughes |
| View Public Profile |
| Find all posts by grahamhughes |
|
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. |
| carsamba55 |
| View Public Profile |
| Find all posts by carsamba55 |
|
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 ? :D
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 ? |
|
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 :)
|
| carsamba55 |
| View Public Profile |
| Find all posts by carsamba55 |
|
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 ?
|
|
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);
}
|
| carsamba55 |
| View Public Profile |
| Find all posts by carsamba55 |
|
Here the size of the 2 created images:
Menu.png = 46kb Logo = 8kb Can this be the problem? |
| carsamba55 |
| View Public Profile |
| Find all posts by carsamba55 |
|
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. |
| grahamhughes |
| View Public Profile |
| Find all posts by grahamhughes |
|
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. |
| grahamhughes |
| View Public Profile |
| Find all posts by grahamhughes |
|
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... |
| carsamba55 |
| View Public Profile |
| Find all posts by carsamba55 |
|
that 46 kb png whats its resolution in pixels ?
|
|
Can you post the contents of your JAR's MANIFEST file?
|
| grahamhughes |
| View Public Profile |
| Find all posts by grahamhughes |
|
Quote:
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 Quote:
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 :) Quote:
Quote:
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... |
| carsamba55 |
| View Public Profile |
| Find all posts by carsamba55 |
|
Quote:
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:
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. |
| grahamhughes |
| View Public Profile |
| Find all posts by grahamhughes |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| ###Upgrading Firmware### | zahid44 | General Discussion | 27 | 2008-10-21 08:17 |