Migrating apps to SensorCore SDK 1.2

Migrating an application from an older version of the SensorCore SDK to version 1.2 unfortunately may require some refactoring because of changes in the operating system in how location privacy settings are being handled. In Windows 10, instead of displaying location consent prompt at application download time, the prompt is now being displayed by the OS the first time a location-based API is being called. The user can now also go to system settings to enable or disable location access per application. None of the SensorCore APIs will be able to work unless the user has given location consent to the application. This includes getting SensorCore settings (SenseHelper.GetSettingsAsync()) and querying sensor availability (IsSupportedAsync()). If location access has been disabled for an application, calling SensorCore APIs will now throw an exception with an error code SenseError.LocationDisabled. You need to make sure that the exception is handled properly. For examples about how to handle exceptions properly, see the Quick start and Essential practices sections.

  • SenseHelper.GetApiStateAsync() has been removed from the SDK. If your application is using this API, you will need to refactor it to use SenseHelper.GetSenseSettingsAsync() instead.
  • SenseHelper.GetSupportedCapabilitiesAsync() has been deprecated. It is still available, but you should switch to using SenseHelper.GetSupportedApiSetAsync() instead.

The GetSupportedApiSetAsync() method returns APIs level 1, 2, 3, or 4, and features available in each API level are listed below. A higher API level includes the previous level of API functionality.

  • Level 1:

    • Level 1 is the baseline. It covers everything else not listed under the other API set levels.
  • Level 2:

    • PlaceKind: new property: Frequent
    • TrackPoint: new property: Id
    • Added triggers:

      • StepCounterUpdate
      • MotionDataCleared: This trigger will also be supported if the supported API set is 1, but the motion data version is 2.
      • SenseApiStateChanged: This trigger will also be supported if the supported API set is 1, but the motion data version is 2.
  • Level 3:

    • New activity classes:

      • Biking
      • MovingInVehicle
    • DataCollectionQuality can have value Detailed if set in new Motion data 2.x settings.
  • Level 4:

    • Place has new properties:

      • Timestamp
      • LengthOfStay
      • TotalLengthOfStay
      • TotalVisitCount
      • New methods available in PlaceMonitor:
      • GetPlaceHistoryAsync()
      • GetPlaceAtAsync()

Please see the Essential practices section for more details about how to use the new APIs. Details of the features available in each API level are described in the API reference document.

Show: