Original Post
Ok, so I got this phone for my birthday today. Nothing fancy (Nokia 5140i), but it's better than my 7 year old one... Anyhow, I figured I'd try to program some games to it using J2ME. Naturally, I want to be able to load .PNG:s as a graphical resource. This does not appear to work however, neither in an emulator nor the phone, despite everything indicating it would work. As far as I know the phone is CLDC/MIDP2.0/JTWI compatible. Is there some mysterious missing fact I've missed here? It's hilarious because I've worked on a simple side scroller the entire day under the assumption it would be able to render images... Effectively screwing up my entire plan if it can't. Any advice would be welcome. Ask me what code to show and I'll show it; anything to help solve the problem.... To start off, why wouldn't this work:
//this code is taken from within my Game class:
private Image[] images = new Image[1]; //declared as an array so I can extend it for all graphics I need
//now, this below method throws the IOException no matter what
//yes, I do have player.png as a correct PNG in the correct res dir
//also, I've tried with example PNGs that came with the WTK, and they also throw same exception
public void loadImages()
{
try
{
images[0] = Image.createImage("player.png");
}
catch(IOException ie)
{
owner.destroyApp(false);
owner.notifyDestroyed();
}
}