title: Best way to evaluate connection speed
body: <p>I'm developing an app which needs to get music file by streaming for playing live.</p>
  
  <p>In the request song api I can specify the bandwith (eg: 50kbps, 100kbps, 300, 600 or 1 Mbps).</p>
  
  <p>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:</p>
  
  <ul>
  <li><p>Detect wether the phone is using 3g, wifi or Edge and specify an bandwith for each connection speed.</p></li>
  <li><p>Let the user decide the quality of the song he will get: like youtube (but the users won't be people that know much about computing: the more easy is the software, the more it will fit)</p></li>
  <li><p>Having a way to evaluate properly the connection speed: Like fetching a file, measure the time that it took and set the bandwith.</p></li>
  </ul>
  
  <p>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.</p>
  
  <p>Maybe you have experience about that you would like to share? </p>
  
  <p>Thank you!</p>