Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

Is it possible to limit internet speed of Android device

for example

  • Nexus 7 only internet speed has 300 kbps / 1mbps
  • Nexus 4 only internet speed has 150 kbps / 1mbps
share|improve this question
    
Do you mean over your WiFi network? Typically you'd configure this on your router. (Yes, I realize this is an old question...) –  derobert Jun 6 '13 at 21:38
add comment

2 Answers 2

up vote 0 down vote accepted

While not for the faint of heart, how about the Linux command Traffic Control? Check out the man page for a quick run-down.

You'll need root and the Android Terminal Emulator app (or similar). I think this guide will be helpful, especially the script quoted below (although because I'm not rooted I haven't tried it myself). You can either try to run the script using sh or using BASH, or simply type the commands from the script directly in terminal after replacing the variables with your desired values. Let us know how it goes.

#!/bin/bash
#
#  tc uses the following units when passed as a parameter.
#  kbps: Kilobytes per second 
#  mbps: Megabytes per second
#  kbit: Kilobits per second
#  mbit: Megabits per second
#  bps: Bytes per second 
#       Amounts of data can be specified in:
#       kb or k: Kilobytes
#       mb or m: Megabytes
#       mbit: Megabits
#       kbit: Kilobits
#  To get the byte figure from bits, divide the number by 8 bit
#

#
# Name of the traffic control command.
TC=/sbin/tc

# The network interface we're planning on limiting bandwidth.
IF=eth0             # Interface

# Download limit (in mega bits)
DNLD=1mbit          # DOWNLOAD Limit

# Upload limit (in mega bits)
UPLD=1mbit          # UPLOAD Limit

# IP address of the machine we are controlling
IP=216.3.128.12     # Host IP

# Filter options for limiting the intended interface.
U32="$TC filter add dev $IF protocol ip parent 1:0 prio 1 u32"

start() {

# We'll use Hierarchical Token Bucket (HTB) to shape bandwidth.
# For detailed configuration options, please consult Linux man
# page.

    $TC qdisc add dev $IF root handle 1: htb default 30
    $TC class add dev $IF parent 1: classid 1:1 htb rate $DNLD
    $TC class add dev $IF parent 1: classid 1:2 htb rate $UPLD
    $U32 match ip dst $IP/32 flowid 1:1
    $U32 match ip src $IP/32 flowid 1:2

# The first line creates the root qdisc, and the next two lines
# create two child qdisc that are to be used to shape download 
# and upload bandwidth.
#
# The 4th and 5th line creates the filter to match the interface.
# The 'dst' IP address is used to limit download speed, and the 
# 'src' IP address is used to limit upload speed.

}

stop() {

# Stop the bandwidth shaping.
    $TC qdisc del dev $IF root

}

restart() {

# Self-explanatory.
    stop
    sleep 1
    start

}

show() {

# Display status of traffic control status.
    $TC -s qdisc ls dev $IF

}

case "$1" in

  start)

    echo -n "Starting bandwidth shaping: "
    start
    echo "done"
    ;;

  stop)

    echo -n "Stopping bandwidth shaping: "
    stop
    echo "done"
    ;;

  restart)

    echo -n "Restarting bandwidth shaping: "
    restart
    echo "done"
    ;;

  show)

    echo "Bandwidth shaping status for $IF:"
    show
    echo ""
    ;;

  *)

    pwd=$(pwd)
    echo "Usage: tc.bash {start|stop|restart|show}"
    ;;

esac

exit 0
share|improve this answer
add comment

Well There is no such app at the moment but google is planning to introduce this in the near future.. Bandwidth Throttling Feature

share|improve this answer
    
No, not data usage, I mean having an internet usage limit in android device –  Glenn-- Nov 19 '12 at 8:23
    
do you mean usage through the browser? but should not include apps internet usage such as gmail etc. –  Dilberted Nov 19 '12 at 8:26
    
All android apps... –  Glenn-- Nov 19 '12 at 8:27
    
if you use the application above it will limit the internet usage. you can define a limit and once that limit is reached the applications would not be able to access the internet. I think that is what you want. if not, please clarify in detail. –  Dilberted Nov 19 '12 at 8:29
    
do you really need an app in the phone? or you may want to use alternate methods as well such methods are without the phone app. –  Dilberted Nov 19 '12 at 8:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.