Accessibility

Table of Contents

Porting J2ME games to Flash Lite

Supporting multiple devices in Flash Lite and J2ME

The biggest advantage Flash Lite has over J2ME is that a single compiled swf file can be supported on multiple devices. In theory that is true, but it is important to note that in real-world examples, the content may need to be redesigned to fit the mobile device. User experience can be affected if content that was designed for larger screens is scaled to display on a phone.

The S60 mobile devices come with different screen sizes. The list below shows the most common dimensions:

  • 176 X 208
  • 240 X 320
  • 352 X 416
  • 320 X 240

A common practice in game development is to start building on a base device, usually using a screen resolution of 176px x 208px. Once the content is completely ready, (after the testing phase and bug fixes are completed), the game content is sent to the porting team to port it for multiple devices.

The process of porting in J2ME is different from the porting for Flash Lite. In J2ME games, developers often hard code every value. The values for moving a sprite, for placing a sprite on a canvas, for setting up a tiled background and for setting up fonts on the canvas during run-time are usually all hard coded. That means that in order to port a J2ME game to a bigger screen size, the hard coded values must be updated. Also, since the graphics in J2ME games are bitmaps, the graphics will need to be redesigned at a larger size and enhanced for a higher resolution screen size (see Figure 5).

Bitmap game graphics ported to a larger screen size must be re-created to display correctly

Figure 5. Bitmap game graphics ported to a larger screen size must be re-created to display correctly

As a game developer ports a J2ME game, they must also change the API. In these situations, the code itself must also be changed.

It is much easier to port a Flash Lite game across multiple devices, because you have complete control over the UI and the inside game elements. You can manipulate graphics and fonts during author-time. Additionally, since the graphics are already vectors, the elements only require resizing and do not need to be recreated to display on different screen sizes (see Figure 6).

Vector graphics have an advantage because they can be resized to fit various screen sizes

Figure 6. Vector graphics have an advantage because they can be resized to fit various screen sizes

Flash runs uniformly on all platforms, because it does not depend upon the platform API. This is definitely a huge time saver because it is not necessary to change your code unless you have hard coded the game values when developing.