I am trying to make wifi scanner for my project which does 20 scan when I hit the scan button. When I run the code its scans but I dont know it scans for 20 times or not and the
Update: You can take a look at my demo for RF measurements using Android device, where you can found a couple of approaches, here:
https://github.com/panosvas/Measurements
where you can find an implementation of WiFi measurements one after another. I have also created a Server for storing these measurements as well as a remote trigger app using UDP packets where you can find here:
https://github.com/panosvas/IndoorPositioningServer
It is possible to obtain multiple measurements. Your approach is wrong due to the fact that the for loop will be executed probably in mseconds and each wifi measurement in Android keeps approximately 5 seconds based on the device. One approach to achieve your goal is the following:
Keep in mind that in order to obtain correct measurements you have to wait until each measurement finishes otherwise you will take duplicates of the same measurement.