7.7.7 Key Presses
The Canvas class in MIDP supplies the keyPressed() , keyRe-
peated() and keyReleased() methods. They do not exist in DoJa,
where all event handling is handled by the processEvent() method
of the canvas. You need to explicitly check for the type of the event (e.g.
Display.KEY_PRESSED_EVENT ) and respond to it appropriately.
In DoJa, connections can only be opened to the server specified in the
application's ADF. DoJa also limits these to HTTP and OBEX connections.
MIDP applications that use raw sockets or datagram connections need a
lot of work to address this one.
The other issue to remember here is that there are size limits for both
uploading (5 KB) and downloading (10 KB) over these connections. This
can be problematic as an attempt to download, for example, a 50 KB
image does not fail - you just get the first 10 KB.
There are a number of workarounds for this, such as incremental
downloading and local caching. The DoJa Developer Network (DDN)
has a good tutorial 11 that discusses a variety of techniques commonly
used to deal with this issue.
7.7.9 Bluetooth Wireless Technology
Applications that rely on Bluetooth are in trouble unless you're using at
least DoJa 5.0. There is no easy way around this limitation.
7.7.10 Audio Playback
In DoJa, the AudioPresenter class is used instead of MIDP's MMAPI
Player concept. It uses a different lifecycle and does not support the
WAV audio format - audio files in DoJa are either in the Melody For
i-mode (MFi) format or Standard MIDI File (SMF) format. The MFi format
(contained in .mld files) is the sound format used in Flash animations,
however the general development community avoids using it due to the
fact that MFi generation software is not publicly available and there are a
wide variety of versions to manage. 12 The easiest approach to take here
is to simply use MIDI.
11 www.doja-developer.net/ up/features/feature1 7/index.php?id=44
12 There is a good review of this topic on the MDL website: groups.google.com/group/