views:

13

answers:

0

Hi! I'm writing an app where at one point I have to scan for Wlan values(ssid, rss, mac) several times at once (I need to make the mean value of several rss values I received during the scans). This happens when the user presses a button. After the button having been pressed, the scanning process starts, takes 10 scans, calculates the mean rss value and returns this to the UI or any other intermediate processes. My problem is the choice of process (Thread, AsyncTask, or whatever), because of android's callback mechanism when receiving the Wifi values. This mechanism does not allow to use a thread which has one run() method, as this method has to stop due to BroadcastReceiver#onReceive() being called when the scan is complete. Same problem with AsyncTask
So can somebody tell me if there is some kind of mechanism provided by android which helps me out of this situation?