04-02-2009 07:06 PM
I have a question. Which is the faster in drawing on blackberry devices: BB UI API or J2ME Canvas API. I have heard that J2ME provides GameCanvas which has the capability of flushing the off screen buffer content from out side of paint method. That means if you want to update the screen you don't have to wait till paint method called. On otherhand, for BB you can only call invalidate() to update your display and that is not at instance call to paint method.But since its BB's native UI, it may be faster than GameCanvas (although I am not sure). Please advice what to choose for graphics programming.
04-03-2009 12:50 AM - edited 04-03-2009 06:05 AM
A combination of BlackBerry and J2ME APIs should be your choice ...
PS. Even if it is J2ME API, it is implemented in Blackberry devices, by RIM alone and not SUN
EDIT: I didn't know it was about graphics, am I sleepy when replied this thread
04-03-2009 03:44 AM
04-03-2009 06:03 AM
It's a matter of portability mostly.
The J2ME classes will be portable to other phones. However, much of this code probably comes ready coded with a set of JNI (C functions) to be ported to the Qualcomm chip in the phone by whomever provides RIM with their JVM.
However, the Blackberry classes will be implemented by RIM themselves. So, I'd guess that using the RIM classes are faster, as they probably use the GPU to implement triangle fills and so forth. They also have functionality that isn't availble in the regular J2ME. For example, there is no polygon fill function in J2ME, but in the Blackberry Graphics class, they have functions like drawFilledPath that will draw and fill a polygon.
I've posted a few helper posts giving tips related to some of this and some of the missing math functions that are available in the Blackberry classes.
If given the option, use the blackberry classes, as they are faster and more powerful with a lot more functionality.
If you want portability, stick to the J2ME classes.
If you are doing graphics, you shouldn't mix the J2ME and Blackberry classes related to canvas and screen and so forth, but you can use J2ME bluetooth discovery classes for example at the same time as using blackberry graphics classes.
i.e. Be careful that you don't mix J2ME drawing and Blackberry drawing, as you can get really lost....
Hope that helps.