1

I am trying to compare the web page loading time between 3G network and WiFi, so I am looking for classes that can be used in android for this purpose.

But so far I have not found any very useful class.

Has anybody done this before and what did you guys use?

Thanks in advance :)

Geo
  • 12,666
  • 4
  • 40
  • 55
Evan_HZY
  • 984
  • 5
  • 17
  • 34

2 Answers2

1

I think this will help you: Execute this with different network connections:

//start a timer here
URL url = new URL("http://www.android.com/");
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
try 
{
   InputStream in = new BufferedInputStream(urlConnection.getInputStream());
   readStream(in);
   //End timer after read stream. Log the time difference.
   finally 
   {
     urlConnection.disconnect();
   }
}
Sadeshkumar Periyasamy
  • 4,848
  • 1
  • 26
  • 31
0

To compare loading times between WiFi and 3G on Android you could use WebDevTools:

https://play.google.com/store/apps/details?id=com.voltcode.webdevtools

disclaimer - I am connected to the company that released this software.

voltaire
  • 213
  • 2
  • 8