0

Exist some way in java for android, to detect the faster download url and choose the faster?

Example i have two urls for the same thing, and i want to choose the faster according to different location, that may have one faster than another.

1 Answers1

0

How about you ping to a website from your app and keep track of time spent in receiving a response?

See How to ping a website from an Android activity and get response?

you can use startTime and endTime variables in the code and compare the difference.

 try{ 
    Log.e("checking", "Checking network connection...");
    //startTime
    httpClient.execute(httpGet);
   //EndTime
    Log.e("checking", "Connection OK");
    return; 
} 
Community
  • 1
  • 1
Karan
  • 2,120
  • 15
  • 27