You can read /proc/net/dev for network traffic statistics. On my phone, it looks like this:
Inter-| Receive | Transmit face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed lo: 562 8 0 0 0 0 0 0 562 8 0 0 0 0 0 0 dummy0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 rmnet0: 38329 220 0 0 0 0 0 0 33316 310 0 0 0 0 0
......
I am using a 2G network that is visible from the rmnet0 interface. You can analyze the contents of the file and get information about the speed in the network.
I want this to help.
source share