03-09-2009 03:32 PM
Take my existing j2me app and compile and run it in the RIM JDE so that it qualifies for the BlackBerry App World.
What I've done so far:
I've taken my j2me MIDlet app and copied it into Eclipse (with RIM JDE plugin). I finally got to the point where it finds my main MIDlet class, compiles and runs. Yes!
Unfortunately, all references to image files are lost. Thus any reference to these files throws an exception.
All of my image files are in the "res" folder (just under "src" in the hierarchical tree). I've tried moving the images to different folders but with no luck. And I've also tried referencing the same image files in different ways: "/res/image.png", "res/image.png", "/image.png", "image.png".
Has anyone out there successfully developed a MIDlet using the RIM JDE? Any help is appreciated! -Jason
Solved! Go to Solution.
03-09-2009 05:15 PM
did u move the j2me Midlet from netbeans environment ? first make sure u have added the res folder to your eclipse project. Set java build path(for src and res) first in project properties.
moreover, Midlets can be developed using RIM JDE.
03-10-2009 12:15 AM
Thank you for the suggestion! It lead me to a solution...
Although I had tried adding the res folder to the build path before, it seems that it was in the wrong place. Or, at least, that's what it seems because all I did to get it working was to create a new "res" folder one level up (just below the project and on par with the "src" folder) and move my image files to this folder. I added this folder to the project's build path and then my reference to "/res/image.png" worked!
And, yes, I did move the MIDlet from the Netbeans environment.
08-21-2009 04:40 PM - edited 08-21-2009 04:48 PM
Actually, I believe this to be a Blackberry Eclipse plug-in bug (or Eclipse issue). See my post about it here
but here is a short summary:
The reason I believed it 'worked' for reyrj when he remade the folder is that the new files he placed in the folder will now have the 'BlackBerry File Properties' set such that the files can now be found when the program runs (check the files properties settings by right clicking on the file name and then selecting 'Properties'. You will see Resource, BlackBerry File Properties and Run/Debug Settings.
The bug occurs once you exit from Eclipse. Eclipse looses the 'BlackBerry File Properties' for the files upon restart. Check it out - right click on the file name and then select 'Properties' and then 'BlackBerry File Properties' - for files which can be found when running the program they will have a General tab that pops up with default settings for the file. Files which cannot be found by BlackBerry will not have any screen popup.
This bug seems to only occur when the folder is not in the 'src' directory. If you place your folder containing non-java files within the 'src' folder things will be fine when exiting Eclipse and returning and you won't need to exclude these files from the compilation (may depend on the file extension however - haven't tried them all).