SensorCapabilities Class

  • java.lang.Object
    • com.microsoft.azure.spatialanchors.SensorCapabilities

public class SensorCapabilities

Use this class to give the session access to sensors to help find anchors around you. This is typically used by a [PlatformLocationProvider](./platformlocationprovider.md) to configure sensors. Refer to [Coarse Relocalization](https://aka.ms/CoarseRelocalization) to learn more about sensors and platforms.

Method Summary

Modifier and Type Method and Description
void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

boolean getBluetoothEnabled()

Whether to use Bluetooth signals to find anchors and improve the locatability of existing anchors. Make sure that you also set KnownBeaconProximityUuids when enabling Bluetooth. Enabling this option requires extra permissions on each platform: * Android: Declare BLUETOOTH_ADMIN, BLUETOOTH and ACCESS_COARSE_LOCATION in AndroidManifest.xml and obtain the permissions at run-time by calling ActivityCompat.requestPermissions(). * HoloLens: Add the "bluetooth" capability to your app's package manifest. * iOS: Add the "Privacy - Location When In Use Usage Description" key to Info.plist with a short description of what the permission is for.

boolean getGeoLocationEnabled()

Whether to use the device's global position to find anchors and improve the locatability of existing anchors. Enabling this option requires extra permissions on each platform: * Android: Declare ACCESS_FINE_LOCATION in AndroidManifest.xml and obtain the permission at run-time by calling ActivityCompat.requestPermissions(). * HoloLens: Add the "location" capability to your app's package manifest. * iOS: Add the "Privacy - Location When In Use Usage Description" key to Info.plist with a short description of what the permission is for.

String [] getKnownBeaconProximityUuids()

Controls which Bluetooth beacon devices the session is able to see. Add the proximity UUIDs here for all beacons you want to use to find anchors and improve the locatability of existing anchors. Only Eddystone-Uid and iBeacon UUIDs are supported. If no UUIDs are provided, Bluetooth beacons will not be tracked.

boolean getWifiEnabled()

Whether to use WiFi signals to find anchors and improve the locatability of existing anchors. Enabling this option requires extra permissions on each platform: * Android: Declare CHANGE_WIFI_STATE, ACCESS_WIFI_STATE and ACCESS_COARSE_LOCATION in AndroidManifest.xml and obtain the permissions at run-time by calling ActivityCompat.requestPermissions(). * HoloLens: Add the "wiFiControl" capability to your app's package manifest. * iOS: Add the "Privacy - Location When In Use Usage Description" key to Info.plist with a short description of what the permission is for.

void setBluetoothEnabled(boolean value)

Whether to use Bluetooth signals to find anchors and improve the locatability of existing anchors. Make sure that you also set KnownBeaconProximityUuids when enabling Bluetooth. Enabling this option requires extra permissions on each platform: * Android: Declare BLUETOOTH_ADMIN, BLUETOOTH and ACCESS_COARSE_LOCATION in AndroidManifest.xml and obtain the permissions at run-time by calling ActivityCompat.requestPermissions(). * HoloLens: Add the "bluetooth" capability to your app's package manifest. * iOS: Add the "Privacy - Location When In Use Usage Description" key to Info.plist with a short description of what the permission is for.

void setGeoLocationEnabled(boolean value)

Whether to use the device's global position to find anchors and improve the locatability of existing anchors. Enabling this option requires extra permissions on each platform: * Android: Declare ACCESS_FINE_LOCATION in AndroidManifest.xml and obtain the permission at run-time by calling ActivityCompat.requestPermissions(). * HoloLens: Add the "location" capability to your app's package manifest. * iOS: Add the "Privacy - Location When In Use Usage Description" key to Info.plist with a short description of what the permission is for.

void setKnownBeaconProximityUuids(String[] value)

Controls which Bluetooth beacon devices the session is able to see. Add the proximity UUIDs here for all beacons you want to use to find anchors and improve the locatability of existing anchors. Only Eddystone-Uid and iBeacon UUIDs are supported. If no UUIDs are provided, Bluetooth beacons will not be tracked.

void setWifiEnabled(boolean value)

Whether to use WiFi signals to find anchors and improve the locatability of existing anchors. Enabling this option requires extra permissions on each platform: * Android: Declare CHANGE_WIFI_STATE, ACCESS_WIFI_STATE and ACCESS_COARSE_LOCATION in AndroidManifest.xml and obtain the permissions at run-time by calling ActivityCompat.requestPermissions(). * HoloLens: Add the "wiFiControl" capability to your app's package manifest. * iOS: Add the "Privacy - Location When In Use Usage Description" key to Info.plist with a short description of what the permission is for.

Method Details

finalize

protected void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

getBluetoothEnabled

public boolean getBluetoothEnabled()

Whether to use Bluetooth signals to find anchors and improve the locatability of existing anchors. Make sure that you also set KnownBeaconProximityUuids when enabling Bluetooth. Enabling this option requires extra permissions on each platform: * Android: Declare BLUETOOTH_ADMIN, BLUETOOTH and ACCESS_COARSE_LOCATION in AndroidManifest.xml and obtain the permissions at run-time by calling ActivityCompat.requestPermissions(). * HoloLens: Add the "bluetooth" capability to your app's package manifest. * iOS: Add the "Privacy - Location When In Use Usage Description" key to Info.plist with a short description of what the permission is for.

getGeoLocationEnabled

public boolean getGeoLocationEnabled()

Whether to use the device's global position to find anchors and improve the locatability of existing anchors. Enabling this option requires extra permissions on each platform: * Android: Declare ACCESS_FINE_LOCATION in AndroidManifest.xml and obtain the permission at run-time by calling ActivityCompat.requestPermissions(). * HoloLens: Add the "location" capability to your app's package manifest. * iOS: Add the "Privacy - Location When In Use Usage Description" key to Info.plist with a short description of what the permission is for.

getKnownBeaconProximityUuids

public String [] getKnownBeaconProximityUuids()

Controls which Bluetooth beacon devices the session is able to see. Add the proximity UUIDs here for all beacons you want to use to find anchors and improve the locatability of existing anchors. Only Eddystone-Uid and iBeacon UUIDs are supported. If no UUIDs are provided, Bluetooth beacons will not be tracked.

getWifiEnabled

public boolean getWifiEnabled()

Whether to use WiFi signals to find anchors and improve the locatability of existing anchors. Enabling this option requires extra permissions on each platform: * Android: Declare CHANGE_WIFI_STATE, ACCESS_WIFI_STATE and ACCESS_COARSE_LOCATION in AndroidManifest.xml and obtain the permissions at run-time by calling ActivityCompat.requestPermissions(). * HoloLens: Add the "wiFiControl" capability to your app's package manifest. * iOS: Add the "Privacy - Location When In Use Usage Description" key to Info.plist with a short description of what the permission is for.

setBluetoothEnabled

public void setBluetoothEnabled(boolean value)

Whether to use Bluetooth signals to find anchors and improve the locatability of existing anchors. Make sure that you also set KnownBeaconProximityUuids when enabling Bluetooth. Enabling this option requires extra permissions on each platform: * Android: Declare BLUETOOTH_ADMIN, BLUETOOTH and ACCESS_COARSE_LOCATION in AndroidManifest.xml and obtain the permissions at run-time by calling ActivityCompat.requestPermissions(). * HoloLens: Add the "bluetooth" capability to your app's package manifest. * iOS: Add the "Privacy - Location When In Use Usage Description" key to Info.plist with a short description of what the permission is for.

Parameters:

value - The new value.

setGeoLocationEnabled

public void setGeoLocationEnabled(boolean value)

Whether to use the device's global position to find anchors and improve the locatability of existing anchors. Enabling this option requires extra permissions on each platform: * Android: Declare ACCESS_FINE_LOCATION in AndroidManifest.xml and obtain the permission at run-time by calling ActivityCompat.requestPermissions(). * HoloLens: Add the "location" capability to your app's package manifest. * iOS: Add the "Privacy - Location When In Use Usage Description" key to Info.plist with a short description of what the permission is for.

Parameters:

value - The new value.

setKnownBeaconProximityUuids

public void setKnownBeaconProximityUuids(String[] value)

Controls which Bluetooth beacon devices the session is able to see. Add the proximity UUIDs here for all beacons you want to use to find anchors and improve the locatability of existing anchors. Only Eddystone-Uid and iBeacon UUIDs are supported. If no UUIDs are provided, Bluetooth beacons will not be tracked.

Parameters:

value - The new value.

setWifiEnabled

public void setWifiEnabled(boolean value)

Whether to use WiFi signals to find anchors and improve the locatability of existing anchors. Enabling this option requires extra permissions on each platform: * Android: Declare CHANGE_WIFI_STATE, ACCESS_WIFI_STATE and ACCESS_COARSE_LOCATION in AndroidManifest.xml and obtain the permissions at run-time by calling ActivityCompat.requestPermissions(). * HoloLens: Add the "wiFiControl" capability to your app's package manifest. * iOS: Add the "Privacy - Location When In Use Usage Description" key to Info.plist with a short description of what the permission is for.

Parameters:

value - The new value.

Applies to