Java Reference
In-Depth Information
one thing you can do is provide an isolation layer that abstracts the nonstandard API, and
implement to that isolation layer. This lets you swap in and out implementations of the
isolation layer that conform to specific API implementations, so that as you port your
code from one nonconforming device to another, you minimize the changes in your
application to the nonstandard API.
If the interface consists solely of logic, you can also make a reference implementa-
tion yourself; for example, consider how you could use the kXML parser on devices that
do not support XML parsing through JSR 172. Of course, you may be able to do this to
make up for deficiencies in devices that don't provide implementation for a specific API,
too. This approach can also help you when working with the Sun Java Wireless Toolkit,
because you may not be able to run your application without the optional API you're
missing in emulation, making it more difficult to develop and debug your application.
You should also consider becoming part of the solution by joining the JCP and par-
ticipating in the standards process yourself.
Understanding the JTWI
The JTWI, defined by JSR 185, was one of the first attempts to unify the optional APIs
available for Java ME devices—specifically, mobile phones. Finalized by 2003, it actually
requires very little above and beyond the CLDC/MIDP stack that most Java-enabled
mobile phones were including at the time. It was a crucial milestone, however, in that it
set out some clear goals for Java ME implementations of mobile phones.
On the hardware front, the JTWI makes some strong recommendations, the following
being chief among them:
Color screen : The device must have a minimum screen size of 125 125 pixels,
with a pixel aspect ratio of 1:1. The screen must be color, with a color depth of at
least 12 bits.
Heap : The device must have at least 256KB of heap available to the Java VM.
Thus, while it's possible you'll encounter a JTWI device with a smaller screen or heap,
it's extremely unlikely.
JTWI devices must meet some rigid specifications, including the following:
JAR file size : The AMS must be able to support JAR files of at least 64KB.
JAD file size : The AMS must be able to support JAD files of at least 5KB.
Record store: The record store implementation must be able to store at least 30KB.
Threads : The Java VM must permit a MIDlet suite to create a minimum of 10
simultaneously running threads.
 
Search WWH ::




Custom Search