title: Reducing delay between two wifi scans
body: <p>I'm writing an android application which purpouse is to determine the user position via a wifi fingerprint, and in order to do that i need to get really  frequent (as frequent as possible) scansions of present networks but I've found time limitations to do that.</p>
  
  <p>In fact, no matter what, I can get a new scan roughtly every second and I was wondering if there could be a way to speed things up.</p>
  
  <p>Past questions on the topic (as this one <a href="https://stackoverflow.com/questions/5880453/android-wifi-active-scans">Android, wifi active scans</a>) were not really useful.</p>
  
  <p>here's the code:</p>
  
  <pre><code>public class WiFiScanReceiver extends BroadcastReceiver {
      private static final String TAG = "WiFiScanReceiver";
      private Main parent;
      private ScanResult storedBest;
      private String actualFileName;
      private int nOfScans;
      private long initialTime;
      private FileSaver fs;
  
      public WiFiScanReceiver(Main wifiDemo) {
          super();
          this.parent = wifiDemo;
          storedBest = null;
          actualFileName ="";
          nOfScans = 0;
          fs = new FileSaver(parent);
      }
  
      @Override
      public void onReceive(Context c, Intent intent) {
          List&lt;ScanResult&gt; results = parent.getWifiManager().getScanResults();
          ScanResult bestSignal = null;
          if(parent.isRecording()&amp;&amp; actualFileName!=""){
  
          //Getting the fingerprint
          }
  
          if (parent.isRecording()) nOfScans ++;
          parent.getWifiManager().startScan();
          Log.d(TAG, "onReceive() message: " + message);
      }
      //VARIOUS GETTERs AND SETTERs
  
  }
  </code></pre>