Saideira
Saideira

Reputation: 2434

Detect network connection bandwidth (Android)

I need to determine programmatically the bandwith of the network connection (not the same as network type (WIFI/3G)). How can i do this? Timing a (short) download?

thanks

Upvotes: 0

Views: 875

Answers (2)

Najd
Najd

Reputation: 41

that's for the download and for the upload I used a socket (TCP) and I tried to write an array of bytes in its outputstream so fast as I can and in the end I flush the buffer and devided the number of bytes by the time elapsed to write the whole array in the outputstream.

another alternativ is to try to upload a something big and then devide the "something big" by the time took to upload.

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1007554

Step #1: Download something big.

Step #2: Divide the size of the "something big" by the time it took to download to get your bandwidth.

Upvotes: 1

Related Questions