Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Simulating a Slow Network Connection When Testing on Mobile Devices

DZone's Guide to

Simulating a Slow Network Connection When Testing on Mobile Devices

· Java Zone
Free Resource

Managing a MongoDB deployment? Take a load off and live migrate to MongoDB Atlas, the official automated service, with little to no downtime.

Testing and debugging mobile applications can be a pain sometimes. If you're using an emulator, there may be features you can't even replicate (come on, network providers), and while testing on an actual device can bring a lot more real-world use to the table, there can still be some major gaps. For example, how do you simulate non-ideal use conditions on a real device? This article from Artur Kim takes a look at one in particular: slow network connections.

Kim is direct and to the point when it comes to getting this done:

Using a wireless router we can use Linux traffic shaping to add delay, slow down the throughput and also randomly drop packets. For this example I used OpenWRT because I’m familiar with it and because it has a long list of supported routers, but DD-WRT might work too. Get a supported router and a snapshot image of the unstable Barrier Breaker release for the router. Flash it and set up your wifi.

He then goes into more detail on setting up the wifi, and includes a shell script to set the parameters where you need them to be. 

If you need to simulate a slow connection on an actual device, then, take a look at Kim's full article. It's an interesting look at a frustrating problem, and potentially a great starting point for a variety of similar problems.

MongoDB Atlas is the easiest way to run the fastest-growing database for modern applications — no installation, setup, or configuration required. Easily live migrate an existing workload or start with 512MB of storage for free.

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}