For All You Game Developers

Example MIDlet

This is an example mobile application that demonstrates the use of MoiDev API in wireless devices. The example uses an open-source KXML library, which is specifically designed for wireless devices, for XML parsing.

The main functionality with MoiDev API is in the PalLoaderExample class. The class takes the information given in the pal form and the hardcoded API URL, fetches the data provided by the API and parses it into a PalData object. In this example it also automatically downloads the character images given in the XML data.

The user interface uses basic JME UI components for prompting the pal data and a Canvas class with reasonably straightforward drawing routines for drawing the pal data onto screen. The DrawPal function is a useful example on how to draw the pal walk animations using the offsets provided by the API.

The example MIDlet is about 50 kilobytes in size which means it's compatible with most MIDP 2.0 compatible devices. The majority of the space is taken by the KXML library which is used for XML parsing, and developing a specific XML parser for MoiDev use would give further savings in space.

Downloads:

MoiDevMidlet application binary jar (non-obfuscated)

MoiDevMidlet source code zip.

Links

KXML homepage

MoiDev Midlet example running on Nokia emulator.