is a Java
program for embedded devices, more specifically the J2ME
virtual machine. Generally, these are games and applications that run on a cell phone
MIDlets will (should) run on any device that implements J2ME Mobile Information Device Profile. Like all Java programs, MIDlets are "compile once, run anywhere". To write a MIDlet, you can get Sun's Wireless Toolkit from the Java website, available on several platforms and free as in beer.
Hints for writing MIDlets:
- Heap sizes can be very small, around 20kb. Therefore, use as few objects as possible and dereference them when they are no longer needed. Also catch OutOfMemoryErrors if you intend to allocate larger amounts of data.
- Programs can not expect more than 8kb persistant storage. Don't keep more than you need.
- Keep in mind that a device can have very different screen dimensions, orientations and color depths. In other words, don't use absolute position.
- Not all devices have keypads or pointers. One should be able to use the program with both. Keylayouts may vary too, so use Game Actions for up-down-left-right-action style events.
- Don't white list devices. If the program hasn't been tested on a specific device, assume it works. Never attempt to block the user from trying it.