Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Revision as of 14:38, 29 May 2007 by valery_bogdanov (Talk | contribs)

No more portings-designing scalable games

From Wiki
Jump to: navigation, search

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.

67 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×