diff --git a/src/com/upc/pbe/upcnews/MainActivity.java b/src/com/upc/pbe/upcnews/MainActivity.java index 855d156..8cd15ca 100644 --- a/src/com/upc/pbe/upcnews/MainActivity.java +++ b/src/com/upc/pbe/upcnews/MainActivity.java @@ -41,18 +41,21 @@ public class MainActivity extends Activity implements OnClickListener { new Thread() { public void run() { //Wifi Info + int speed = 0; for (int i = 0; i < 5; i++) { wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); WifiInfo info = wifi.getConnectionInfo(); - int speed = info.getLinkSpeed(); - String str = "Speed: " + speed; - Log.d(TAG, str); + speed = speed + info.getLinkSpeed(); try { Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } + } + + String str = "Speed: " + speed/5; + Log.d(TAG, str); } }.start();