Download fulltext - DiVA Portal

Transcript
9.2
Implementation challenges
111
OPTIMISING THE CODE
During the implementation we thought a lot about how we could make the application
use as little resources on the mobile phone as possible. This helped increase the speed
of the application and in the end we were fairly pleased with the result. However, we
have only tried the application on a Sony Ericsson K700i, which is a couple of years old,
and we expect that the performance will be better on a newer model. This will be due
to increased network speed and better Java performance. As illustrated in figure 9.1,
especially the latter has improved dramatically over the last two years36 . Compared to
our test model, SE K700i, the new phones are often two to three times faster.
Figure 9.1: Java MIDP 2.0 performance
(adapted from [74] and [75])
One of the measures we took to ensure a modest use of resources was to set the object
variables to null as soon as we knew we would not need them any more. This way
they can be collected by the garbage collector and will not take up space in the phone’s
memory.
To decrease the overall size of the application and satisfy NF-3 we also introduced the
abstract class LibertyMessage. This was done because we saw that the three SOAP
message classes had a lot of methods in common. Thus there would be a large amount
of redundant code if this measure had not been taken.
36
The figure is based on tests performed by use of JBenchmark testing and published in Amobil :: Test
- Nokia 3250 [74] and Amobil :: Test - Sony Ericsson K700i [75]. In this kind of test, an application
measures the time required to perform a standard set of operations on the phone.