This section describes a mobile application named Swap-
per. We developed a set of experiments in order to create
a testing scenario for our middleware. The mobile appli-
cation oers a service of automatic swapping between the
mobile local storage system and the external storage system
running on a server connected through Internet. Automatic
swapping allows mobile devices to release storage space in a
transparent way. We made some experiments looking for a
good replacement policy that takes into account the follow-
ing issues: average storage space in current mobile devices,
average le size, average data transfer rate in common LAN
and WAN wireless networks like Wi-Fi y GPRS.
In order to choose a good replacement policy to be imple-
mented in Swapper, we simulated four dierent algorithms
based on the average measures taken from real mobile de-
vices and wireless networks. The results obtained from the
simulations help us to decide which policy replacement algo-
rithm to implement in our Swapper application. The main
task of a replacement algorithm is to decide which le will be
sent to the external storage server to release storage space
in the local memory. The following policies were evaluated:
LRU (Least Recently Used), LFU (Least Frequently Used),
LFS (Largest File Size), SFS (Smallest File Size). The av-
erage le size obtained from dierent mobile phones was
1.3MB. Most of the les were images and music. We made
tests trying to nd an optimal block size for transmission
of les regardless of the wireless network. The better re-
sults were obtained with a block size of 1KB. Particularly in
GPRS networks which have more restricted bandwidth com-
pared to WiFi and where big blocks increased packet loss.
The average time obtained of transmitting les of 1.3MB
from dierent mobiles devices to an external storage server
connected on Internet using Wi-Fi was 8.3s. This measure
helped us to calculate the average transmission time of each
algorithm in mobile devices with dierent le sizes and mem-
ory sizes. The hit ratio and average transmission time ob-
tained in each replacement policy showed that, if the Swap-
per replaces les based on the largest le size (LFS) obtains
the best hit ratio, but it also obtains the greatest average
transmission time. These results could be a good decision
point when the cost of the wireless communication depends
on time consumption (like GMS networks). Most of the
cases the wireless communication service is calculated based
on bandwidth consumption. These simulations gave us in-
sights at the moment of deciding which algorithm could be
implemented like a caching service for our middleware, since
it is important to consider all of the costs in terms of time
and bandwidth consumption.