Commit d3f3ab850e64167de61c10c27fee180477993153
1 parent
11ecfb03
--no commit message
Showing
1 changed file
with
6 additions
and
3 deletions
src/com/upc/pbe/upcnews/MainActivity.java
... | ... | @@ -41,18 +41,21 @@ public class MainActivity extends Activity implements OnClickListener { |
41 | 41 | new Thread() { |
42 | 42 | public void run() { |
43 | 43 | //Wifi Info |
44 | + int speed = 0; | |
44 | 45 | for (int i = 0; i < 5; i++) { |
45 | 46 | wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE); |
46 | 47 | WifiInfo info = wifi.getConnectionInfo(); |
47 | - int speed = info.getLinkSpeed(); | |
48 | - String str = "Speed: " + speed; | |
49 | - Log.d(TAG, str); | |
48 | + speed = speed + info.getLinkSpeed(); | |
50 | 49 | try { |
51 | 50 | Thread.sleep(1000); |
52 | 51 | } catch (InterruptedException e) { |
53 | 52 | e.printStackTrace(); |
54 | 53 | } |
54 | + | |
55 | 55 | } |
56 | + | |
57 | + String str = "Speed: " + speed/5; | |
58 | + Log.d(TAG, str); | |
56 | 59 | } |
57 | 60 | }.start(); |
58 | 61 | ... | ... |