Categories: Java | Java ME | S60 | Series 40 | Porting | Architecture/Design
This page was last modified 10:27, 28 November 2007.
No more portings-designing scalable games
From Forum Nokia Wiki
For now the majority of mobile game developers choose the strategy of creating multiple JAR-files for each mobile platform.
But I want to suggest alternative method: one JAR-file for different J2ME platforms. In "different platforms" I mean mobile phones with different screen resolution, heap size, available API's etc.
Contents |
Main positions of designing platform independent applications
Do not import classes of additional API's
Instead of this use Class.forName() method.
For example:
try { Class.forName("com.nokia.mid.ui.FullCanvas"); return PLATFORM_NOKIA; } catch (Throwable ex) { }
If you use imports your game/application may not install properly on all target devices.
Resolution independent UI and game elements
Game designers have to design screen resolution independent User Interface of the game. This means that coordinates of UI and game elements have not to be hardcoded. Instead of this you have to determine positions and sizes of UI and game elements depending on the current mobile phone's screen resolution.
To make all inscriptions and texts normally readable on target devices use system fonts. But pay attention that UI should specialize to the actual font height and width.
Do not use specific platform features
For example:
- Avoid using vibration from Nokia UI API classes, because it doesn't work on Nokia S60 devices.
- On Samsung devices it is necessary to invoke System.gc() method to clear heap memory of unneeded images, but you shouldn't invoke it on other devices to avoid lags.
Use platform independed controls
How to use it is described in the article: Platform_independent_key_events_processing
Test your game/application on each target platform
To agree that your game/application works properly on all target devices it is recommended to test game/application on a real devices or use Forum.Nokia Program Remote Device Access.
Benefits of platform independent games/applications
- Reducing cost and estimation of a game/application development;
- Simplification of a product support for development and marketing teams because of one JAR-file;
- Same game features for all platforms;
- Simplification of a distribution;
- Product evolution and improvement simplification;
Shortcomings
- Insignificant increasing of JAR-file size, because functionality for all platforms is included to only build;
- Developer is limited with the most "weak" device from a supported range;
Summary
As we can see, designing of platform independent games/applications is real alternative for multiple JAR-files strategy which can appreciably reduce estimation of development and as consequence to reduce development cost.
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 3310 games | linal | Digital Rights Management & Content Downloading | 1 | 1970-01-01 02:00 |
| latest development of mobile games | ngzq2 | Mobile Java Games | 3 | 2006-07-11 20:16 |
| N-gage on 6600 = color problems | adamtrance | General Discussion | 3 | 2005-01-20 21:57 |
| N-Gage & Bluetooth | moamoa | Mobile Java General | 0 | 2003-05-19 11:19 |
| Problems with MIDP 1.0 games on Nokia 6600 | sebflash | Mobile Java General | 9 | 2003-11-11 13:01 |
