Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simulate slow network on Android simulator

I'm building an app that uses AsyncTask to display a progress bar when it's performing network operation (Google translate). However, the problem is that I can't tell if it's working since the network is too fast and it finishes running the operation as soon as I start it. So is there a way to simulate a slow network so that I can tell if the progress bar will actually run (visible) when it's waiting for the operation to be completed? I have come across network options when creating an Android emulator. However, there are so many abbreviations that I still have trouble understanding what indicates slow network connection and I'm still not sure if that is how I should set a slow network connection.

Thanks in advance!

like image 562
Charles Li Avatar asked Jul 01 '16 02:07

Charles Li


People also ask

How do you simulate slow Internet connection react native?

Go to the Network tab of your React Native debugger. You can simulate a network connection by clicking on the "No throttling" dropdown. You can choose among presets such as 2G or 3G, but you can also create your own preset based on your needs.


2 Answers

The emulator lets you simulate various network conditions. You can approximate the network speed for different network protocols, or you can specify Full, which transfers data as quickly as your computer allows.

Specifying a network protocol is always slower than Full. You can also specify the voice and data network status, such as roaming. The defaults are set in the AVD.

Select a Network type:

  • GSM - Global System for Mobile Communications
  • HSCSD - High-Speed Circuit-Switched Data
  • GPRS - Generic Packet Radio Service
  • EDGE - Enhanced Data rates for GSM Evolution
  • UMTS - Universal Mobile Telecommunications System
  • HSPDA - High-Speed Downlink Packet Access
  • Full (default)

Speeds for reference in increasing kbps:

                        UP       DOWN                   -------- ---------- gsm   GSM/CSD         14.4       14.4 hscsd HSCSD           14.4       57.6 gprs  GPRS            28.8       57.6 umts  UMTS/3G        384.0      384.0 edge  EDGE/EGPRS     473.6      473.6 hsdpa HSDPA         5760.0   13,980.0 lte   LTE         58,000.0  173,000.0 evdo  EVDO        75,000.0  280,000.0 full  No limit           ∞          ∞ 

Select a Voice status, Data status, or both:

  • Home (default)
  • Roaming
  • Searching
  • Denied (emergency calls only)
  • Unregistered (off)

For more information see https://developer.android.com/studio/run/emulator.html#extended

like image 65
Diego Torres Milano Avatar answered Sep 21 '22 14:09

Diego Torres Milano


In OS X you can use Network Link Conditioner, very useful. Here is a link how to use it and how to install. It will affect all programs using network.

http://nshipster.com/network-link-conditioner/ enter image description here

Also you can send all traffic to proxy and use throttling. I used Charles (Commercial, 30 days free trial) https://www.charlesproxy.com/

like image 35
Anessence Avatar answered Sep 22 '22 14:09

Anessence