3 Game enclosures and game action Nokia new model mobile phone support game enclosure may affect game action. Nokia's first mobile phone can use the game housing is Nokia 3510i. If the phone supports the game housing, there will be a setting dialog in the gaming menu of the device, allowing the user to set the game action corresponding to the button on the game housing. The user must set this button mapping, otherwise the game that is designed to use the ordinary keyboard layout cannot be run. 4 At the same time, multiple NOKIA phones (for example, Nokia 6310i, 3410, 7210) do not support the simultaneous multi-button (that is, if you hold the UP button, then MIDlet will not know if you press the Fire button). Although NOKIA 7650 supports simultaneous pressing multiple bile (for example, holding the "1" and "3" keys), the joystick key is physically unable to press the left and press the left, so it is impossible to have oblique in the game. The movement is moved, and a "click" cannot be recorded when it is down, down, left or right. 5 Key name: Avoid hard-coding your own text string to avoid associating hard-coded text and keyboard code in your MIDlet. The CANVAS class provides a method for returning the text name associated with each keyboard code: PUBLIC STATIC STRING GETKEYNAME (INT Keycode); the problem with the current NOKIA device is that this method always returns an English string instead of the user's language selection. In future NOKIA devices, this string may option based on the user's language. If your purpose is to develop portable games, you must remember that getKeyname returns different values in different NOKIA MIDP devices. 6 Using the full screen Draw (Fullcanvas) function key A full-screen drain-based function key can only be used to exit from the game screen to a different screen state. NOKIA user interface with Fullcanvas class Apply programming interfaces clearly provides a full-screen graphics area for drawing, available for many types of games. Inheriting the NOKIA User Interface Application Programming Interface Class Fullcanvas game screen will not use keyboard code of the function key to do game-related action, unless it is used to return from the game screen to the menu. If a MIDlet application needs to use the function key command, you must use the default MIDP Canvas class, especially if your MIDlet needs to use the tag function key. When you use Fullcanvas, you should not provide your own function key label. 7 MIDlet International You may need to target your MIDlet - for example, for different regions and languages. MIDP system properties "microedition.locale" defines the current area of the device. Its value can be used using System.getProperty. Method. The MIDP specification allows you to use an null value in this system properties. However, null value is not allowed in the NOKIA's MIDP implementation. The system properties of CLDC "microEdition.Encoding" define the default character encoding of the device. Its value can be obtained using the System.GetProperty method. For more MIDlet localization issues, please refer to the "Writing World Aware J2ME Applications" http://wireless.java.sun.com/midp/tips/worldaware/ resource package. There is currently no standard mechanism in MIDP to handle resource packages. This document uses a simple way to separate the user interface text from the main program. It is processed in the Resource class (2, 9).
It is very important to join an international feature to a MIDlet, but this may increase your MIDlet size. If the MIDlet size is a problem for some specific MIDP device, you may want to produce several different compilers of MIDlets. Each version can be one or more areas, locally localized. 8 Equipment Features: Sound, Vibration and Light If you use the NOKIA user interface Apply programming interface class Sound or DeviceControl, you should provide an Options or Settings menu and a setup editor to allow end users to start or cancel. setting. However, if you apply programming interface class Sound or DeviceControl (vibrating, light) using the NOKIA user interface and to install your game to the Games menu (see 1, 11), the Games menu has provided by setting the JAD parameter <>. Settings Allow End User to start or cancel these features. Therefore, the application does not have to create such a feature yourself. In addition to the NOKIA UI API technical documentation, you can also refer to "Nokia UI API Program 's Guide", which provides a lot of useful information. 9 Device-independent Nokia MIDP devices may differ from screen size, keyboard layout, and available APIs. In order to create portable games, these differences should be considered when designing games. The application should ask the system to ask the screen size and avoid hard coding coordinates when drawing the screen content. This can be used to use the GetHeight and getWidth methods of the Canvas class. Different NOKIA MIDP devices have changed significantly, and developers should check the application programming interfaces on the device platform you want to develop. This can be done, the vibration is a good example.
Try {class.Forname ("com.nokia.mid.ui.deviceControl);} catch (classnotfoundexception e) {// can't use vibration Because the API // is not supported in the device} Inherited in the default MIDP The game screen of the Canvas class replaces the manufacturer's specific Fullcanvas class, which helps improve your MIDlet's portability; however, it is impossible to achieve full screen. 10 Optimized MIDP device is very limited, so care should be taken when using memory. For games, a very important limit is a limited heap memory: In order to save a stack of memory, object references no longer need to be set to "null" so that these objects can be garbage-collected. The color screen mobile phone requires more memory to handle bitmaps in the application, which is related to the larger screen depth and the associated internal data structure. Therefore, although an application may be written on a mobile phone on a black and white screen, it may consume more dynamic memory when used on a color screen phone: For NOKIA 7210, it shows a picture than NOKIA 6310i 16 times memory. Developers should take into account this factor when designing applications, and should minimize the number of images simultaneous. For example, a flash screen image should be able to collect before the game graphic image (by setting all the references to the image object as "null"). 11 Installation By default, MIDlet is installed under the Applications menu of the Nokia device. If the device has a Games menu, MIDlet can also be installed under this menu by setting the NOKIA-MIDLET-CATEGORY: GAME parameter in the MIDlet .jad file. Author: wayne compile posted from: yesky.com Author Blog:
http://blog.9cbs.neet/mobilechannel/