0

Does someone know if there is a way to limite the bandwidth of our Android application programatically ?

Thank You

Lina Hammami
  • 373
  • 1
  • 4
  • 22
Anthone
  • 2,156
  • 21
  • 26
  • 1
    What exactly do you mean? Limit the rate at which transfer is done? Cap it? Capping it shouldn't be too hard, just calculate how much you've used. Note that different providers may track bandwidth differently so you can't always be 100% accurate – Brydon Gibson Jun 02 '17 at 13:27
  • Application will download lot of video all the time in background. But during period my client want to limit the download speed to not use all bandwith – Anthone Jun 14 '17 at 08:29

2 Answers2

0

If you are writing an application you should may be able to control the rate at which you download content. See Android: how to limit download speed.

If the phone is rooted you may be able to leverage the OS to limit bandwidth. Either by using iptables or tc (traffic control). I believe this is how BradyBound works

Stu
  • 57
  • 2
0

If you're trying to throttle your app so that it doesn't use too much bandwidth, use's the answer from Stu.

If you're looking to test low bandwidth scenarios, or run the app with a simulated, crummier data connection, you can do this in the debug settings of a device or on your emulator: https://developer.android.com/studio/run/emulator-commandline.html

Look for -netspeed and -netdelay to simulate different sorts of networking scenarios and connectivity.

Scott Merritt
  • 1,284
  • 2
  • 13
  • 24