From d3f3ab850e64167de61c10c27fee180477993153 Mon Sep 17 00:00:00 2001 From: Equip de Desenvolupadors de PBE Date: Sun, 2 Dec 2012 16:52:55 +0000 Subject: [PATCH] --- src/com/upc/pbe/upcnews/MainActivity.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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(); -- libgit2 0.22.2