androidnetwork-programming3gandroid-wifi

Best way to evaluate connection speed


I'm developing an app which needs to get music file by streaming for playing live.

In the request song api I can specify the bandwith (eg: 50kbps, 100kbps, 300, 600 or 1 Mbps).

The more the bandwith is big, the more the file will get time to be fetched. As I don't want the users to be restricted about that I have multiple choices to deal with it:

I know that connection speed could vary a lot if user loose the wifi, or is using 3g moving in the street. And the thing is that I can't change the bandwidth when the song will be playing.

Maybe you have experience about that you would like to share?

Thank you!


Solution

  • Facebook released a library for this:

    https://github.com/facebook/network-connection-class

    this wasn't existing in 2011..