Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit adbb46e

Browse files
Updated to use latest Lumia SensorCore SDK 1.1 Preview
1 parent 3d0e47f commit adbb46e

14 files changed

Lines changed: 60 additions & 41 deletions

BackgroundTasks/BackgroundTasks.csproj

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
<Compile Include="Properties\AssemblyInfo.cs" />
4848
</ItemGroup>
4949
<ItemGroup>
50-
<None Include="Help\LumiaSensorCoreSDK.chm" />
5150
<None Include="packages.config" />
5251
</ItemGroup>
5352
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '12.0' ">
@@ -56,20 +55,7 @@
5655
<PropertyGroup Condition=" '$(TargetPlatformIdentifier)' == '' ">
5756
<TargetPlatformIdentifier>WindowsPhoneApp</TargetPlatformIdentifier>
5857
</PropertyGroup>
59-
<ItemGroup>
60-
<Reference Include="Lumia.Sense, Version=255.255.255.255, Culture=neutral, processorArchitecture=MSIL">
61-
<SpecificVersion>False</SpecificVersion>
62-
<HintPath>..\packages\LumiaSensorCoreSDK.1.0.3.263\lib\portable-wpa81+wp81\x86\Lumia.Sense.winmd</HintPath>
63-
</Reference>
64-
<Reference Include="Lumia.Sense.Testing, Version=255.255.255.255, Culture=neutral, processorArchitecture=MSIL">
65-
<SpecificVersion>False</SpecificVersion>
66-
<HintPath>..\packages\LumiaSensorCoreSDKTesting.1.0.3.263\lib\portable-wpa81+wp81\x86\Lumia.Sense.Testing.winmd</HintPath>
67-
</Reference>
68-
</ItemGroup>
6958
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\$(TargetPlatformVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
70-
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
71-
<Import Project="..\packages\LumiaSensorCoreSDK.1.0.3.263\build\wpa81\LumiaSensorCoreSDK.targets" Condition="Exists('..\packages\LumiaSensorCoreSDK.1.0.3.263\build\wpa81\LumiaSensorCoreSDK.targets')" />
72-
<Import Project="..\packages\LumiaSensorCoreSDKTesting.1.0.3.263\build\wpa81\LumiaSensorCoreSDKTesting.targets" Condition="Exists('..\packages\LumiaSensorCoreSDKTesting.1.0.3.263\build\wpa81\LumiaSensorCoreSDKTesting.targets')" />
7359
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
7460
Other similar extension points exist, see Microsoft.Common.targets.
7561
<Target Name="BeforeBuild">

BackgroundTasks/packages.config

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="LumiaSensorCoreSDK" version="1.0.3.263" targetFramework="wpa81" />
4-
<package id="LumiaSensorCoreSDKTesting" version="1.0.3.263" targetFramework="wpa81" />
53
</packages>

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ returns.
5656

5757
3. Version history
5858
--------------------------------------------------------------------------------
59+
* Version 1.1.0.3: Updated to use latest Lumia SensorCore SDK 1.1 Preview
5960
* Version 1.1.0.2:
6061
* Some bug fixes made in this release.
6162
* Version 1.1:
@@ -70,6 +71,7 @@ returns.
7071

7172
| Project | Release | Download |
7273
| ------- | --------| -------- |
74+
| Steps | v1.1.0.3 | [steps-1.1.0.3.zip](https://github.com/Microsoft/steps/archive/v1.1.0.3.zip) |
7375
| Steps | v1.1.0.2 | [steps-1.1.0.2.zip](https://github.com/Microsoft/steps/archive/v1.1.0.2.zip) |
7476
| Steps | v1.1 | [steps-1.1.zip](https://github.com/Microsoft/steps/archive/v1.1.zip) |
7577
| Steps | v1.0 | [steps-1.0.zip](https://github.com/Microsoft/steps/archive/v1.0.zip) |

Steps/AboutPage.xaml.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ public AboutPage()
3838
this.Loaded += (sender, args) =>
3939
{
4040
var ver = Windows.ApplicationModel.Package.Current.Id.Version;
41-
VersionNumber.Text = string.Format("{0}.{1}.{2}", ver.Major, ver.Minor, ver.Revision);
41+
VersionNumber.Text = string.Format("{0}.{1}.{2}.{3}", ver.Major, ver.Minor,ver.Build, ver.Revision);
42+
4243
};
4344
}
4445
}

Steps/App.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
* The MIT License (MIT)
23
* Copyright (c) 2015 Microsoft
34
* Permission is hereby granted, free of charge, to any person obtaining a copy
45
* of this software and associated documentation files (the "Software"), to deal

Steps/DataConverter.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
* The MIT License (MIT)
23
* Copyright (c) 2015 Microsoft
34
* Permission is hereby granted, free of charge, to any person obtaining a copy
45
* of this software and associated documentation files (the "Software"), to deal

Steps/DataModels/MainModel.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
* The MIT License (MIT)
23
* Copyright (c) 2015 Microsoft
34
* Permission is hereby granted, free of charge, to any person obtaining a copy
45
* of this software and associated documentation files (the "Software"), to deal

Steps/LocalizedStrings.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
* The MIT License (MIT)
23
* Copyright (c) 2015 Microsoft
34
* Permission is hereby granted, free of charge, to any person obtaining a copy
45
* of this software and associated documentation files (the "Software"), to deal
@@ -26,7 +27,7 @@ namespace Steps
2627
/// </summary>
2728
public class LocalizedStrings
2829
{
29-
#region Variable declarations
30+
#region Private members
3031
/// <summary>
3132
/// Resource instance.
3233
/// </summary>

Steps/MainPage.xaml.cs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
* The MIT License (MIT)
23
* Copyright (c) 2015 Microsoft
34
* Permission is hereby granted, free of charge, to any person obtaining a copy
45
* of this software and associated documentation files (the "Software"), to deal
@@ -69,11 +70,53 @@ protected async override void OnNavigatedFrom(NavigationEventArgs e)
6970
/// <param name="e">Provides data for non-cancelable navigation events</param>
7071
protected async override void OnNavigatedTo(NavigationEventArgs e)
7172
{
73+
await InitCore();
7274
await App.Engine.ActivateAsync();
7375
UpdateMenuAndAppBarIcons();
7476
}
7577
#endregion
7678

79+
private async Task InitCore()
80+
{
81+
if (!await StepCounter.IsSupportedAsync())
82+
{
83+
MessageBoxResult dlg = MessageBox.Show("Unfortunately this device does not support step counting");
84+
}
85+
else
86+
{
87+
// MotionDataSettings settings = await SenseHelper.GetSettingsAsync();
88+
// Starting from version 2 of Motion data settings Step counter and Acitivity monitor are always available. In earlier versions system
89+
// location setting and Motion data had to be enabled.
90+
uint apiSet = await SenseHelper.GetSupportedApiSetAsync();
91+
MotionDataSettings settings = await SenseHelper.GetSettingsAsync();
92+
if (apiSet > 2)
93+
{
94+
if (!settings.LocationEnabled)
95+
{
96+
MessageBoxResult dlg = MessageBox.Show("In order to count steps you need to enable location in system settings. Do you want to open settings now?", "Information", MessageBoxButton.OKCancel);
97+
if (dlg == MessageBoxResult.OK)
98+
await SenseHelper.LaunchLocationSettingsAsync();
99+
}
100+
if (!settings.PlacesVisited)
101+
{
102+
MessageBoxResult dlg = new MessageBoxResult();
103+
if (settings.Version < 2)
104+
{
105+
dlg = MessageBox.Show("In order to count steps you need to enable Motion data collection in Motion data settings. Do you want to open settings now?", "Information", MessageBoxButton.OKCancel);
106+
}
107+
else
108+
{
109+
dlg = MessageBox.Show("In order to collect and view visited places you need to enable Places visited in Motion data settings. Do you want to open settings now? if no, application will exit", "Information", MessageBoxButton.OKCancel);
110+
}
111+
if (dlg == MessageBoxResult.OK)
112+
await SenseHelper.LaunchSenseSettingsAsync();
113+
else
114+
Application.Current.Terminate();
115+
}
116+
}
117+
}
118+
}
119+
77120
/// <summary>
78121
/// Executes when the Step graph finished loading.
79122
/// </summary>

Steps/Package.appxmanifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest">
3-
<Identity Name="NokiaDeveloper.StepsLumiaSensorCoreSDKsample" Publisher="CN=4AD6DA08-6C39-4A10-98CC-3243374DA59C" Version="1.1.0.2" />
3+
<Identity Name="NokiaDeveloper.StepsLumiaSensorCoreSDKsample" Publisher="CN=4AD6DA08-6C39-4A10-98CC-3243374DA59C" Version="1.1.0.3" />
44
<mp:PhoneIdentity PhoneProductId="c80afab2-39d5-406a-abbe-3777e3f0b625" PhonePublisherId="5bda2eda-1ca9-45c9-9a87-77701f1fd0ca" />
55
<Properties>
66
<DisplayName>Steps – Lumia SensorCore SDK sample</DisplayName>

0 commit comments

Comments
 (0)