Drawing scalable numbers with J2ME

One of the users suggested that Mobile Trail Explorer (MTE) should have a speedometer screen which shows current speed with large numbers so that it could be used as a normal speedometer while driving a bike. One of the challenges is that MTE runs on different devices and therefore on different screen resolutions. For example my Nokia N80 has a very large resolution of 352 x 416 while latest N series devices are usually running with 240 x 320 and older devices are using smaller 176 x 208 resolution.

Using the bitmap fonts would have been a solution but that would require us to store bitmaps for every resolution and that would eat up a lot of valuable memory. I have used bitmaps fonts on SubOthello game. I think that it suits really well for mobile games which are targeted and built separately for different devices.

Trail Explorer Speedometer

To solve this more generic way, I created a NumberArea class for, which This is used to draw an area into Canvas where numbers such as speed and distance are rendered with basic Graphic methods such as fillRect(…) and fillRoundRect(…). If you are interested you can take a look into a source code.

On a side note: We are now on feature freeze with MTE so that we can release the v1.11 within a week or so.

One Response to “Drawing scalable numbers with J2ME”

  1. Smith Says:

    Thanks a lot. It helped me to code my application in mobile.

Leave a Reply