As explained in this article, in order to compute the most accurate geolocation, Situm can use many of the sensor information that modern smartphones provide.  


Situm SDK allows you to activate/deactivate most of these sensors when computing indoor geolocations. This can come in handy to activate special features by enable a certain sensor, saving battery by disabling another, etc.


1. WiFi


WiFi device is enabled by default for Indoor Positioning, therefore Situm SDK will read the WiFi scans gathered by the smartphone and use them as a source of Indoor Positioning. This can be controlled with the LocationRequest.Builder().useWifi method.

//Option 1: Wifi based indoor positioning is activated by default
LocationRequest locationRequest = new LocationRequest.Builder().build();

//Option 2: ... you may also activate it explicitly, no harm is done
LocationRequest locationRequest = new LocationRequest.Builder().useWifi(true).build();

//Option 3: ... or you may deactivate it, in case you do not want to use WiFi for indoor positioning
LocationRequest locationRequest = new LocationRequest.Builder().useWifi(false).build();


Ignore WiFi throttling


In Android 5, 6, 7 and 8, applications can scan WiFi signals once every few seconds (1-3 seconds). This is optimal to provide indoor positioning. Unfortunatelly, from Android 9 onwards, Android implements a limitation called WiFi Throttling, that limits number of WiFi scans to 1 every 30 seconds.   


Fortunatelly, in Android 10 and above, you may turn off WiFi Throttling in your device. Once you do so,  you must set to true the method  LocationRequest.Builder().ignoreWifiThrottling. This additional step is required because by default Situm SDK 

 assumes that WiFi Throttling is enabled and therefore optimizes the use of WiFi scans.  


//Android 10 and above: Situm scans WiFi every 30 seconds by default
LocationRequest locationRequest = new LocationRequest.Builder().build();

//Android 10 and above: This is already the default behaviour (WiFi scan every 30 seconds)
LocationRequest locationRequest = new LocationRequest.Builder().ignoreWifiThrottling(false).build();

//Android 10 and above: If you have disabled WiFi Throttling in your smartphone, this will allow your app to scan at full speed
LocationRequest locationRequest = new LocationRequest.Builder().ignoreWifiThrottling(true).build();


This parameter has different behaviour depending on the Android version.  

  1. Android 5, 6, 7, 8. This parameter has no effect. In these versions, Situm SDK always scans at full speed independently of the parameter. This is because these versions do not have the WiFi Throttling limitation in the first place, therefore Situm SDK does not need to take it into account.
  2. Android 9. This parameter has no effect. In these version, Situm SDK always scans once every 30 seconds, independently of the parameter. This is because Android 9 does not allow you to disable WiFi Throttling, therefore WiFi Throttling can not be ignored.
  3. Android 10 and above 
    1. If set to false, Situm SDK will scan once every 30 seconds even if WiFi Throttling has been disabled
    2. If set to true, the behaviour depends on whether WiFi Throttling has been disabled.
      1. If WiFi Throttling has been disabled, Situm SDK will scan WiFi at full speed (once every 1-3 seconds)
      2. Otherwise, Situm SDK will scan 4 times at full speed and then Android will block WiFi scans for 2 minutes approximatelly (as a penalty). After that, Situm SDK will start scanning once every 30 seconds in order to avoid further penalties.



2. BLE


BLE is enabled by default for Indoor Positioning, therefore Situm SDK will read the BLE scans gathered by the smartphone and use them as a source of Indoor Positioning. This can be controlled with the LocationRequest.Builder().useBLE method.


//Option 1: BLE based indoor positioning is activated by default
LocationRequest locationRequest = new LocationRequest.Builder().build();

//Option 2: ... you may also activate it explicitly, no harm is done
LocationRequest locationRequest = new LocationRequest.Builder().useBle(true).build();

//Option 3: ... or you may deactivate it, in case you do not want to use BLE for indoor positioning
LocationRequest locationRequest = new LocationRequest.Builder().useBle(false).build();


Beacon filters


By default, Situm only detects beacons with Situm's UUID (73697475-6D73-6974-756D-736974756D15). Nevertheless, you may use any other iBeacon with a different UUID. 


There are 2 ways you may do this. The first way is explained in the Section "How do I configure my beacons?" of this article. Basically, you may specify in Situm Dashboard the beacon UUID's that you want to scan in each of your buildings. Situm SDK will retrieve this information and act accordingly.  This option is recommended, since it is the most flexible of the two.


Alternativelly, you may hardcode your applications to scan for certain UUIDs Situm SDK to detect any other standard iBeacon by providing its UUID.  This way you will not depend on the configurations that you set in Situm Dashboard, but on the other hand, any change you want to apply will require you to recompile your app. 


You may apply this last option do so by using the method LocationRequest.Builder().addBeaconFilter or LocationRequest.Builder , which receives a BeaconFilter object that specifies any additional beacon UUIDs that should be considered.


//Add "c6d95f11-58b5-493d-a190-874f385c04ea" to the UUIDs to be scanned
LocationRequest locationRequest = new LocationRequest.Builder()
            .addBeaconFilter(new BeaconFilter.Builder().uuid("c6d95f11-58b5-493d-a190-874f385c04ea").build())
            .build();

//You may add several UUIDs to be scanned
     LocationRequest locationRequest = new LocationRequest.Builder()
                .addBeaconFilter(new BeaconFilter.Builder().uuid("c6d95f11-58b5-493d-a190-874f385c04ea").build())
                .addBeaconFilter(new BeaconFilter.Builder().uuid("c6d95f11-58b5-493d-a190-874f385c04eb").build())
                .build();

//You may also use Lists if you prefer
        List<BeaconFilter> listFilters = new ArrayList<BeaconFilter>();
        listFilters.add(new BeaconFilter.Builder().uuid("c6d95f11-58b5-493d-a190-874f385c04ea").build());
        listFilters.add(new BeaconFilter.Builder().uuid("c6d95f11-58b5-493d-a190-874f385c04eb").build());
        LocationRequest locationRequest = new LocationRequest.Builder()
                .addBeaconFilters(listFilters)
                .build();

Auto-enable BLE


The user may at any time disable the general Bluetooth functions on the smartphone. This could prevent Situm SDK to scan BLE signals for positioning, but luckily Situm SDK takes care of this. By default, even if the user disables the Bluetooth, Situm will re-enable it (provided that the LocationRequest.Builder().useBLE has been enabled). See next figure as a graphical explanation.  





You may, however, want to disable this automatism to grant your user more control over the use of the Bluetooth sensor. If this is the case, you may use the LocationRequest.Builder().autoEnableBleDuringPositioning method.


//Disable automatic activation of Bluetooth
LocationRequest locationRequest = new LocationRequest.Builder().autoEnableBleDuringPositioning(false).build();



3. GPS


GPS is disabled by default for Indoor Positioning. If you activate this sensor, Situm SDK will read the GPS information of the smartphone and use it as a source of Indoor Positioning. This can be useful if your building has outdoor areas where GPS coverage is good. In practice, this means that if you activate this sensor the Calibrated or Uncalibrated GPS Indoor modes will be used. Detailed information on this modes can be read here


//Option 1: GPS based indoor positioning is deactivated by default
LocationRequest locationRequest = new LocationRequest.Builder().build();

//Option 2: ... you may also deactivate it explicitly, no harm is done
LocationRequest locationRequest = new LocationRequest.Builder().useGps(false).build();

//Option 3: ... or you may activate it, in case you want to use it
LocationRequest locationRequest = new LocationRequest.Builder().useGps(true).build();

 

Do not mistake the activation of the GPS with the use of the Global Mode. GPS activation enables the use of GPS for Indoor Positioning: that is, within the buildings where Situm technology has been deployed. On the other hand, the Global Mode means that Situm will locate the user anywhere in the world. GPS may also be used to provide a worldwide geolocation when the user is not within a Situm building. 



4. Gyroscope & Compass


Gyroscope and compass are used together to meassure the device's orientation. Gyroscope meassures angular velocity of the smartphone: that is, the rate at which the smartphone turns. Compass meassures the absolute smartphone orientation with respect to the Earth's North. Situm combines them together with a smart fusion algorithm, so that both compensate each other's flaws to provide the most accurate orientation.


Therefore, gyroscope and compass are enabled by default. This is the recommended configuration and it should work just fine in most situations.  


//Option 1: Gyroscope and compass are enabled by default
LocationRequest locationRequest = new LocationRequest.Builder().build();

//Option 2: ... you may also enable them explicitly, no harm is done
LocationRequest locationRequest = new LocationRequest.Builder().useGyro(true).useCompass(true).build();

You may choose to diable any of them by using the LocationRequest.Builder().useGyro and  LocationRequest.Builder().useCompass methods if you consider that any of them is harming the orientation estimation performance in your building. This is not recommended unless you are really sure of what you are doing: please contact our Support Team for guidance first.


//Disable gyro
LocationRequest locationRequest = new LocationRequest.Builder().useGyro(false).build();

//Disable compass
LocationRequest locationRequest = new LocationRequest.Builder().useCompass(false).build();

//Disable both
LocationRequest locationRequest = new LocationRequest.Builder().useGyro(false).useCompass(false).build();