public final ArrayList<WifiRecord> loadWifisOverviewWithin(final int session,final Double minLon,final Double maxLon,final Double minLat,final Double maxLat){
  final ArrayList<WifiRecord> wifis=new ArrayList<>();
  String selection=null;
  String[] selectionArgs=null;
  if (minLon != null && maxLon != null && minLat != null && maxLat != null) {
    selection="b." + Schema.COL_LONGITUDE + " >= ?"+ " AND b."+ Schema.COL_LONGITUDE+ " <= ?"+ " AND b."+ Schema.COL_LATITUDE+ " >= ?"+ " AND b."+ Schema.COL_LATITUDE+ " <= ?";
    selectionArgs=new String[]{String.valueOf(minLon),String.valueOf(maxLon),String.valueOf(minLat),String.valueOf(maxLat)};
  }
  final Cursor cursor=contentResolver.query(ContentUris.withAppendedId(Uri.withAppendedPath(ContentProvider.CONTENT_URI_WIFI,ContentProvider.CONTENT_URI_OVERVIEW_SUFFIX),session),null,selection,selectionArgs,null);
  final int columnIndex=cursor.getColumnIndex(Schema.COL_BSSID);
  final int columnIndex2=cursor.getColumnIndex(Schema.COL_SSID);
  final int columnIndex3=cursor.getColumnIndex(Schema.COL_CAPABILITIES);
  final int columnIndex4=cursor.getColumnIndex(Schema.COL_FREQUENCY);
  final int columnIndex5=cursor.getColumnIndex(Schema.COL_MAX_LEVEL);
  final int columnIndex6=cursor.getColumnIndex(Schema.COL_TIMESTAMP);
  final int columnIndex7=cursor.getColumnIndex(Schema.COL_BEGIN_POSITION_ID);
  final int columnIndex8=cursor.getColumnIndex(Schema.COL_END_POSITION_ID);
  final int columnIndex9=cursor.getColumnIndex(Schema.COL_KNOWN_WIFI);
  while (cursor.moveToNext()) {
    final WifiRecord wifi=new WifiRecord();
    wifi.setBssid(cursor.getString(columnIndex));
    wifi.setSsid(cursor.getString(columnIndex2));
    wifi.setCapabilities(cursor.getString(columnIndex3));
    wifi.setFrequency(cursor.getInt(columnIndex4));
    wifi.setLevel(cursor.getInt(columnIndex5));
    wifi.setOpenBmapTimestamp(cursor.getLong(columnIndex6));
    wifi.setBeginPosition(loadPositionById(cursor.getString(columnIndex7)));
    wifi.setEndPosition(loadPositionById(cursor.getString(columnIndex8)));
    wifi.setCatalogStatus(CatalogStatus.values()[cursor.getInt(columnIndex9)]);
    wifis.add(wifi);
  }
  cursor.close();
  return wifis;
}

public final ArrayList < WifiRecord > loadWifisOverviewWithin ( final int session , final Double minLon , final Double maxLon , final Double minLat , final Double maxLat ) { final ArrayList < WifiRecord > wifis = new ArrayList < > ( ) ; String selection = null ; String [ ] selectionArgs = null ; if ( minLon != null && maxLon != null && minLat != null && maxLat != null ) { selection = "b." + Schema . COL_LONGITUDE + " >= ?" + " AND b." + Schema . COL_LONGITUDE + " <= ?" + " AND b." + Schema . COL_LATITUDE + " >= ?" + " AND b." + Schema . COL_LATITUDE + " <= ?" ; selectionArgs = new String [ ] { String . valueOf ( minLon ) , String . valueOf ( maxLon ) , String . valueOf ( minLat ) , String . valueOf ( maxLat ) } ; } final Cursor cursor = contentResolver . query ( ContentUris . withAppendedId ( Uri . withAppendedPath ( ContentProvider . CONTENT_URI_WIFI , ContentProvider . CONTENT_URI_OVERVIEW_SUFFIX ) , session ) , null , selection , selectionArgs , null ) ; final int columnIndex = cursor . getColumnIndex ( Schema . COL_BSSID ) ; final int columnIndex2 = cursor . getColumnIndex ( Schema . COL_SSID ) ; final int columnIndex3 = cursor . getColumnIndex ( Schema . COL_CAPABILITIES ) ; final int columnIndex4 = cursor . getColumnIndex ( Schema . COL_FREQUENCY ) ; final int columnIndex5 = cursor . getColumnIndex ( Schema . COL_MAX_LEVEL ) ; final int columnIndex6 = cursor . getColumnIndex ( Schema . COL_TIMESTAMP ) ; final int columnIndex7 = cursor . getColumnIndex ( Schema . COL_BEGIN_POSITION_ID ) ; final int columnIndex8 = cursor . getColumnIndex ( Schema . COL_END_POSITION_ID ) ; final int columnIndex9 = cursor . getColumnIndex ( Schema . COL_KNOWN_WIFI ) ; while ( cursor . moveToNext ( ) ) { final WifiRecord wifi = new WifiRecord ( ) ; wifi . setBssid ( cursor . getString ( columnIndex ) ) ; wifi . setSsid ( cursor . getString ( columnIndex2 ) ) ; wifi . setCapabilities ( cursor . getString ( columnIndex3 ) ) ; wifi . setFrequency ( cursor . getInt ( columnIndex4 ) ) ; wifi . setLevel ( cursor . getInt ( columnIndex5 ) ) ; wifi . setOpenBmapTimestamp ( cursor . getLong ( columnIndex6 ) ) ; wifi . setBeginPosition ( loadPositionById ( cursor . getString ( columnIndex7 ) ) ) ; wifi . setEndPosition ( loadPositionById ( cursor . getString ( columnIndex8 ) ) ) ; wifi . setCatalogStatus ( CatalogStatus . values ( ) [ cursor . getInt ( columnIndex9 ) ] ) ; wifis . add ( wifi ) ; } cursor . close ( ) ; return wifis ; }
returns strongest measurement for each wifi within bounding box from tbl_wifis .
