Depends on the handset, and whether you intend to support flipping in your tileset.
You should definitely implement a layer of abstraction, so you can render through various APIs (and various mechanisms within said APIs) without having to rewrite any core game code.
A few notes you will find useful :-
Nokia
- drawPixels on Nokia Series 40’s is approx. 3 times faster than drawImage. (though I believe it is due to the implementation of drawImage having its performance dependant upon the size of the source image).
- drawPixels is broken on Platform 2 series 40’s. (it doesn’t honour clip areas correctly, and under certain cirumstances will blow up with an AIOOBException)
- storing your images in raw 4444 pixel format in the jar will result in the images consuming ~10-15% more jar space.
- drawRegion leaks lots of memory very quickly on midp2 S60’s.
Samsung
- drawRegion is inconsistently buggy across the many different handsets. The general rule is that, only mirroring, flipping and both together work. Though each handset appears to be broken in different ways.
For example, the Samsung D500 can do all 8 transforms - so long as the region of the source image being drawn (in the target coordinate system) does not extend beyond 176 in either X or Y axis’. (co-incidence the screenWidth is 176? I think not…)
The Samsung D600 breaks in a completely different fashion, if the target area of the drawRegion intersects any screen edge, and the transform being performed is a rotation, the source image will become corrupted, and garbage will be drawn to the screen.
The list goes on and on, it is comical how pathetic the phone manufacturers are at implementing a trivially straight-forward API such as midp2.
I realy think Sun need to get their arses in gear, and enforce some kind of quality control on JVM implementations that claim to support a certain API - when they clearly don’t.
The most reliable, most consistent, and best performing midp implementations are easily SonyEricsson.
The high-end Sharp handsets (902SH and similars) are also very good, which is odd after the early handsets were so poo.