Java Reference
In-Depth Information
There is more than one way to handle those subtle differences. You
could choose to apply a technical solution and write more adaptable code
that produces satisfactory results on all the different devices. Alternatively,
you could change the usage and design of the application. In some cases,
you need to apply both techniques.
As we said earlier, a central area of Symbian OS customization is the UI.
Phone manufacturers are required to customize the Symbian OS UI and to
implement their own look and feel. To ensure the user experience remains
identical between Java applications and native applications, Symbian OS
native customization of the UI applies to the Java ME subsystem as well.
This is why similar LCDUI code, when run on Symbian smartphones
from different manufacturers, might produce subtle differences that can
nevertheless significantly change the usage of the application.
In this example, we consider how commands map to softkeys on two
different UI platforms. Let us consider the following snippet of code:
private Command dismiss = new Command("Dismiss", Command.OK, 0);
private Command back = new Command("Back", Command.BACK, 0);
private Command exit = new Command("Exit", Command.EXIT, 0);
private Command reply = new Command("Reply", Command.SCREEN, 0);
private Form form;
public SoftButtonsExamplet0() {
form = new Form("Command Examplet 0");
form.addCommand(dismiss);
form.addCommand(reply);
form.addCommand(back);
form.addCommand(exit);
form.setCommandListener(this);
}
The example uses four command types: OK , BACK , EXIT and SCREEN
to specify the intent of the commands. The four commands are mapped to
softkeys according to the device's native layout. Figure 4.5 illustrates the
differences in how the same application would appear on our reference
devices. As you can see, the Nokia N95 has two softkeys and the Sony
Ericsson W960i has three softkeys.
Now that we have seen the code and the differences, let us think
about how such a small difference can have a significant impact on the
user. For example, consider a usability case which defines that when an
SMS message is received, the user should see the message and respond
or dismiss it with only a single click. Bob uses the application to send
an SMS message from his Sony Ericsson W960i to his colleague Alice,
who uses Nokia N95. Alice should be able to respond to the message or
dismiss it, with only a single click. At the moment, neither Bob nor Alice
can do those actions with a single click.
Although we cannot change the restrictions imposed by LCDUI or by
the softkey layout of the UI platform, there are a few options we can
 
Search WWH ::




Custom Search