I am building my application .cod file without using Blackberry JDE or Eclipse plugin. Everything works fine in the simulator if I hardcode the String arguments which my main() method needs. (I am using Maven to build.)
How do you specify main method arguments? In the Eclipse BlackBerry project properties, in the Application tab, you can specify these arguments. So I assume there must be an equivalent way of doing this by hand-editing the .jdp file or specifying an argument to rapc compiler?
I found that I had to modify two files.
I modified the .jdp
file, adding the line:
MidletClass=arg1&arg2
And I modified the .rapc
file, modifying the line:
MIDlet-1: AppTitle,main/resources/icon.png,arg1&arg2
It appears that at least an ampersand &
or pipe |
character can be used as an argument delimiter. A whitespace character will not work as a delimiter.
Now I can build with Maven. I learned all of this by using the officially-blessed RIM Eclipse plugin, setting the main arguments through the Blackberry project dialog box, and then seeing how those underlying files were changed by the plugin.