08-09-2010 11:37 AM
I am developing a JavaME MIDlet which is being ported to a Blackberry .COD file and have a strange bug showing up once the application is run in the simulator.
I am generating a random int between 64 and 91 which correspond to a char between A and Z, and then painting that char to a canvas. For some reason the code will not paint a J. All other char between A-Z paint correctly. Here is my code.
if (InokuUtils.isKeyboardPresent()) _letter = (char)(InokuUtils.getRandom(26)+65);
else _letter = (char)(InokuUtils.getRandom(10)+48);
And then later
g.drawChar(_letter, _posX , _posY - g.getFont().getHeight()/2 ,
Graphics.TOP | Graphics.HCENTER );
It seams that the simulator draws a blank space in place of the J.
I have yet to deploy the application on a real world device, so I have no way to say if it is a simulator problem or not. The code works correctly in the Sun Java ME emulator.
This problem has confounded me for some time now and any suggestions would be appreciated.
08-11-2010 08:11 PM - edited 08-11-2010 08:11 PM
What BlackBerry Smartphone model and BlackBerry device software version are you testing on? You can find this under Options, About on the BlackBerry Smartphone.
What is the current font set to?
08-11-2010 11:14 PM
Hello Mark thank you for responding.
As of yet I have not tested the application on a real-world device, only in the simulators.
I have run the app in the following simulators; 8300,8910, 9700-T-Mobile.
Will changing the default font on the phone effect the fonts created by MIDlets call to the JavaME Font class?
I have tested the MIDLet on a java phone and the code seems to work fine. It hard for me to say if this a porting issue, a simulator issue, or a code issue.
I do plan to test on a Blackberry device shortly, which should help determine where the glitch is happening.