Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

Speed in Mbps #33

Open
salbiz opened this issue Apr 29, 2017 · 5 comments
Open

Speed in Mbps #33

salbiz opened this issue Apr 29, 2017 · 5 comments

Comments

@salbiz
Copy link

salbiz commented Apr 29, 2017

Hi all I am using this library to get the speed in Mbpsin my app. the function getDownloadKBitsPerSecond() resturns me unexpected values. For instance speeds higher than my internet connection even. I am just trying to download an image file as a task .Please help me out with what I am doing wrong or I can get connection speed. I am not using wifi but mobile data instead.

Will appreciate help in advance.

Thanks
Sal

@erodewald
Copy link

Seeing extremely high Kbits reported by this method, even with the client throttled to 2mbps by a Meraki WAP.

@erodewald
Copy link

erodewald commented Aug 9, 2017

I got another device to test on and realized the bandwidth figures appeared to be correct. For whatever reason, the numerous identical devices I was testing on (Minix Neo X9) all report woefully embellished figures. I noticed that, when showing the source in Android Studio, it used /proc/net/xt_qtaguid/stats instead of what is currently in source - TrafficStats.

It was my mistake to assume that there had been a release since the changeover.

For the time being, @salbiz, I simply don't call startSampling()/stopSampling(), I just put hold DateTime.now() in fields at the pre/post execute and then manually addBandwidth() using the connection's contentLength. So far it's much more accurate.

@SeyelentEco Can we get an updated release from the latest sources? I'm not 100% sure it fixes the issues I see on this Minix hardware, but it makes sense to release the code you wrote.

Thanks

@lsfzlj
Copy link

lsfzlj commented Sep 27, 2017

I got the same problem in HuaWei phone ,I didn't try other phones, the speed was always more than ten Mbps

@Zaraki596
Copy link

Zaraki596 commented Aug 26, 2019

I simply don't call startSampling()/stopSampling(), I just put hold DateTime.now() in fields at the pre/post execute and then manually addBandwidth() using the connection's contentLength. So far it's much more accurate.

@erodewald Can you post the example for it, So that beginners can get a clear understanding of what's going on?

@ssmerechinskiy
Copy link

ssmerechinskiy commented Sep 6, 2019 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants