Mobile Signal Inhibiting for testing your networked MIDlets
2007-02-28
Scope of Article
In this tutorial we’ll step outside of the IDE and into the physical world for a lesson in creating “Network-inhibiting shoeboxes” or magic boxes as I like to call them. The aim of doing this is to create an environment in which we can instantly simulate the loss or lack of a wireless/mobile network.
I first learned this technique while working on a project for a client whose MIDlet needed to download hefty data files just following installation and we needed to ensure that a network drop like one experienced as the result of entering a train tunnel during download would not cause the MIDlet to freeze up, or worse crash.
By making and using your own magic box you’ll be able to make your MIDlets equally robust.
Materials
Steps
Ensuring the shoebox is big enough to fit your mobile device.
If you have a flip phone make sure it fits in the shoebox while flipped open. It is also advisable to choose a shoebox whose lid is completely removable and not joined to the box in any way.
Preparing the shielding.
Cut the aluminum foil into strips roughly 10cm/4″ in width. Cut enough of these strips to cover both the inside and outside of the box with anywhere from 4 to 10 layers. My boxes often require 5 layers to be effective. It’s only aluminum after all.
The lining.
Tape the strips one by one both inside and outside the box. When you feel the box is sufficiently layered in aluminum foil finish by applying extra tape to the lid edge, and to the top of the box where the lid comes into contact with it. This is where the most wear and tear will occur and extra tape will ensure the longevity of your carefully crafted box.
Testing
Depending on the power of your mobile device and the distance and strength of the carrier’s signal you may require more layers of aluminum. You can determine this by inserting the mobile device into the box and closing it for up to one minute. Many devices do not report the true status of the network signal at all times and instead show snapshots at specific intervals. Keep this in mind when testing.
Usage
You’ve finished your magic box and want to put it into action. There are many tests you can conduct against your MIDlet such as determining how it will react in the absense of a network or suddenly going from a connected to an unconnected state. Lastly you may wish to see if your MIDlet can gracefully resume a previously severed connection.
Leaving the lid of your box off, make your MIDlet ready to establish a connection at a single button press and place it into the box.
With the lid half ajar make the MIDlet establish the connection and quickly close the box. Wait one or more minutes then reopen the box. What happened? Is smoke billowing from your mobile device or did it keep its cool and is awaiting its next command?
Using metal tins
You might be wondering if a metal tin or cookie box could suffice in lieu of a cardboard one lined with aluminum.
It may, but in my experience lids for such tins aren’t typically easy to open and close (this is intentional as to keep cookies from becoming soggy.) If you do find
a metal tin that is easy to open however and wish to use it, it is advisable to at least provide some cushioning at the bottom to prevent scratching of your mobile device.
In closing
Is your magic box working like magic for you? I welcome tips and improvements you might have run across so do let me know of your successes (and failures).
Entry Filed under: networking. .
Trackback this post