Changing the Resolution of Java-based Games to Fit Your Nokia Screen

শনিবার, নভেম্বর ২২, ২০০৮
Those who often install Java games on cell phones must have encountered some amusing experience. For example, the game’s display which looks smaller or bigger than the phone’s screen, bigger, or even only appears at the corner of the screen.
Normally, game developer has provided portals for game downloading which have been adjusted with the cell phone types. The troubles occurring in installing Java games happen commonly because the game was downloaded from the wrong site, or because the wrong resolution was selected.

There are some things that we could do. Although they are quite simple, we have tried them and the result was satisfying.
Tool
You need a PC which has Winrar (file extractor application) in it. If you haven’t installed it, you can download Winrar.

Steps
Before changing the resolution, first you have to know the game’s original resolution. You can visit that game developer’s official website to find out about the information details. You also need to know the resolution of your phone screen. Follow the next steps:
1. Open the java file (*.jar) using Winrar. As an example, we will use Scarface game.
2. Open META-INF folder, drag MANIFEST.MF file to the computer (to the desktop or the other folders).
3. Open MANIFEST.MF with Notepad. To do it, right click on the file and double-click on the notepad icon. You will see strings or programming language inside the file.
4. Add these two strings at the last row:
Nokia-MIDlet-Original-Display-Size: xxx,xxx
Nokia-MIDlet-Target-Display-Size: xxx,xxx

Original display size represents the original size of the jar file, while target display size represents the size of your phone’s screen. To write it is easy. Simply change the xxx,xxx with the resolution you desire. For example, if you wish to change a game’s resolution which is originally 176 x 208 pixels into 352 x 216 pixels, you have to write like the followings:
Nokia-MIDlet-Original-Display-Size: 176,208
Nokia-MIDlet-Target-Display-Size: 352,216

Next, save your file (not ‘Save As’).
5. Put MANIFEST.MF file back into the jar file by using Winrar. To do it, simply drag the newly edited MF file to META-INF folder. A dialog box confirming the change of the older file with the new one will pop up. Click on ‘OK’ and Winrar will compress the file into jar file. Look at the size difference of the newly edited file.
6. Install the game on your phone and enjoy its new look. It is easy, isn’t it? When it was tried in our lab, almost all experiments were successful. Unfortunately, not all resolution conversions from large to small were successful, especially from 352 x 288 pixels to 176 x 208 pixels. Have a nice try!