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

Bitbucket is for the code that takes us to Mars, decodes the human genome, or drives your next car. What will your code do? Get started with Bitbucket today, it's free.

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.

Are you using Bitbucket to accomplish your company's mission? Share your company’s mission with #Forthecode for a chance to be featured on our homepage, our social media channels, or win a free t-shirt!

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}