1

Guys how can i use an Asynchronous task and run a loop that gets an updated RSSI on every iteration, and how can i update the UI with onProgressUpdate().

And for the last how can i use a Thread.sleep(500) in my loop to it updates every half second?

GGF
  • 11
  • 2

1 Answers1

1

Check this first. Basically you have to use the WifiManager to scan for available networks and receive the result in a BroadcastReceiver as shown in the tutorial. You can extract any info available for the networks from the ScanResult.

After that everything is quite simple

masp
  • 515
  • 1
  • 5
  • 15
  • Thanks for explication. I've done it. but now i need picked up the strongest signal of Wifi available. I've to speak the wifi that is close, and when the signal weaken talk that is moving away. If you have a stronger signal will replace the previous signal... that's why i want to know how to use thread to update all moments. – GGF Sep 13 '16 at 11:56
  • What do you mean all the time? Get updates every time there is a change in the signal of a network or get updates every 1 or 5 minutes for example? You want this to run only when your app is in the foreground or also in the background? Give more details in your question. – masp Sep 13 '16 at 12:12
  • i need to get the updates every 40 seconds , if the current wifi signal is weaker than the another signal, then the strongest signal prevail. and I need this information at all times with the app is in the foreground and background. – GGF Sep 13 '16 at 12:35
  • 1
    Read this https://developer.android.com/training/scheduling/alarms.html and check the code sample for the alarm scheduler. And check this http://stackoverflow.com/a/8818490/6774854 on how to connect to a wifi – masp Sep 13 '16 at 12:48
  • I do not want to connect to Wifi. I only need to read the strongest signal and make the device speak the network name, and when the signal ceases, talk that is moving away from the Wifi signal. – GGF Sep 13 '16 at 13:03
  • Good luck, then. You have everything you need. – masp Sep 13 '16 at 13:11