Over a million developers have joined DZone.

Simulating a Slow Network Connection When Testing on Mobile Devices

· Java Zone

Learn more about the advantages of moving from a monolithic to microservices architecture.  Brought to you in partnership with IBM.

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.

From Idea to Application gives you the architecture to quickly build, manage and run a range of applications (web, mobile, big data, new smart devices, etc.) on an open-standard, cloud-based platform. See why developers are using IBM Bluemix. Brought to you in partnership with IBM.


The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

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

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

{{ parent.tldr }}

{{ parent.urlSource.name }}