Lumia SensorCore SDK sample for Activity Monitor API.
Перейти к файлу
Satyam Bandarapu f8c28c1966 Updated to use latest Lumia SensorCore SDK 1.1 Preview 2015-03-03 16:37:08 +02:00
.nuget Added day view navigation 2014-10-02 15:09:32 +03:00
Activities Updated to use latest Lumia SensorCore SDK 1.1 Preview 2015-03-03 16:37:08 +02:00
.gitignore Let SDK docs be part of the project 2014-06-23 16:01:05 +03:00
README.md Updated to use latest Lumia SensorCore SDK 1.1 Preview 2015-03-03 16:37:08 +02:00
activities.sln Added day view navigation 2014-10-02 15:09:32 +03:00

README.md

Activities

Activities is a simple application demonstrating the use of the Activity Monitor, one of the four APIs offered by the Lumia SensorCore SDK.

With the phone collecting in the background information about user's activity the application is able to access the recorded activities and build a statistic of the types of activities the user has performed during the current day (from 00:00 to current time). This data will be displayed as a list of activities and their total duration.

The application will also register for receiving activity change notifications from the Lumia SensorCore and will display the change dynamically.

  1. Instructions

Learn about the Lumia SensorCore SDK from the Lumia Developer's Library. The example requires the Lumia SensorCore SDK's NuGet package but will retrieve it automatically (if missing) on first build.

To build the application you need to have Windows 8.1 and Windows Phone SDK 8.1 installed.

Using the Windows Phone 8.1 SDK:

  1. Open the SLN file: File > Open Project, select the file activities.sln
  2. Remove the "AnyCPU" configuration (not supported by the Lumia SensorCore SDK) or simply select ARM
  3. Select the target 'Device'.
  4. Press F5 to build the project and run it on the device.

Alternatively you can also build the example for the emulator (x86) in which case the Activity Monitor will use simulated data (and no history is available with the default constructor used).

Please see the official documentation for deploying and testing applications on Windows Phone devices: http://msdn.microsoft.com/en-us/library/gg588378%28v=vs.92%29.aspx

  1. Implementation

Important files and classes:

The core of this app's implementation is in MainPage.xaml.cs where the Activity Monitor API is initialized (if supported) with its production implementation ActivityMonitor() when the app runs on a real device or with is simulated alternative ActivityMonitorSimulator() when running on emulator.

The API is called through the CallSensorCoreApiAsync () helper function, which helps handling the typical errors, like required features being disabled in the system settings.

The data read via the API is handled in the MyData class which also has an mock implementation (MyDesignData) used in IDE's design mode.

Required capabilities:

The SensorSore SDK (via its NuGet package) automatically inserts in the manifest file the capabilities required for it to work:

<DeviceCapability Name="location" />
<m2:DeviceCapability Name="humaninterfacedevice">
  <m2:Device Id="vidpid:0421 0716">
    <m2:Function Type="usage:ffaa 0001" />
    <m2:Function Type="usage:ffee 0001" />
    <m2:Function Type="usage:ffee 0002" />
    <m2:Function Type="usage:ffee 0003" />
    <m2:Function Type="usage:ffee 0004" />
  </m2:Device>
</m2:DeviceCapability>
  1. Version history

  • Version 1.1.0.17:
    • Updated to use latest Lumia SensorCore SDK 1.1 Preview
  • Version 1.1.0.13:
  • Some bug fixes made in this release.
  • Version 1.0: The first release.
  1. Downloads

Project Release Download
Activities v1.1.0.17 activities-1.1.0.17.zip
Activities v1.1.0.13 activities-1.1.0.13.zip
Activities v1.0 activities-1.0.zip
  1. See also

The projects listed below are exemplifying the usage of the SensorCore APIs