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

Commit

Permalink
Updated to use latest Lumia SensorCore SDK 1.1 Preview
Browse files Browse the repository at this point in the history
  • Loading branch information
satyambandarapu committed Mar 3, 2015
1 parent 3d0e47f commit adbb46e
Show file tree
Hide file tree
Showing 14 changed files with 60 additions and 41 deletions.
14 changes: 0 additions & 14 deletions BackgroundTasks/BackgroundTasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Help\LumiaSensorCoreSDK.chm" />
<None Include="packages.config" />
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '12.0' ">
Expand All @@ -56,20 +55,7 @@
<PropertyGroup Condition=" '$(TargetPlatformIdentifier)' == '' ">
<TargetPlatformIdentifier>WindowsPhoneApp</TargetPlatformIdentifier>
</PropertyGroup>
<ItemGroup>
<Reference Include="Lumia.Sense, Version=255.255.255.255, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\LumiaSensorCoreSDK.1.0.3.263\lib\portable-wpa81+wp81\x86\Lumia.Sense.winmd</HintPath>
</Reference>
<Reference Include="Lumia.Sense.Testing, Version=255.255.255.255, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\LumiaSensorCoreSDKTesting.1.0.3.263\lib\portable-wpa81+wp81\x86\Lumia.Sense.Testing.winmd</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\$(TargetPlatformVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Import Project="..\packages\LumiaSensorCoreSDK.1.0.3.263\build\wpa81\LumiaSensorCoreSDK.targets" Condition="Exists('..\packages\LumiaSensorCoreSDK.1.0.3.263\build\wpa81\LumiaSensorCoreSDK.targets')" />
<Import Project="..\packages\LumiaSensorCoreSDKTesting.1.0.3.263\build\wpa81\LumiaSensorCoreSDKTesting.targets" Condition="Exists('..\packages\LumiaSensorCoreSDKTesting.1.0.3.263\build\wpa81\LumiaSensorCoreSDKTesting.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand Down
2 changes: 0 additions & 2 deletions BackgroundTasks/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="LumiaSensorCoreSDK" version="1.0.3.263" targetFramework="wpa81" />
<package id="LumiaSensorCoreSDKTesting" version="1.0.3.263" targetFramework="wpa81" />
</packages>
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ returns.

3. Version history
--------------------------------------------------------------------------------
* Version 1.1.0.3: Updated to use latest Lumia SensorCore SDK 1.1 Preview
* Version 1.1.0.2:
* Some bug fixes made in this release.
* Version 1.1:
Expand All @@ -70,6 +71,7 @@ returns.

| Project | Release | Download |
| ------- | --------| -------- |
| Steps | v1.1.0.3 | [steps-1.1.0.3.zip](https://github.com/Microsoft/steps/archive/v1.1.0.3.zip) |
| Steps | v1.1.0.2 | [steps-1.1.0.2.zip](https://github.com/Microsoft/steps/archive/v1.1.0.2.zip) |
| Steps | v1.1 | [steps-1.1.zip](https://github.com/Microsoft/steps/archive/v1.1.zip) |
| Steps | v1.0 | [steps-1.0.zip](https://github.com/Microsoft/steps/archive/v1.0.zip) |
Expand Down
3 changes: 2 additions & 1 deletion Steps/AboutPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public AboutPage()
this.Loaded += (sender, args) =>
{
var ver = Windows.ApplicationModel.Package.Current.Id.Version;
VersionNumber.Text = string.Format("{0}.{1}.{2}", ver.Major, ver.Minor, ver.Revision);
VersionNumber.Text = string.Format("{0}.{1}.{2}.{3}", ver.Major, ver.Minor,ver.Build, ver.Revision);
};
}
}
Expand Down
1 change: 1 addition & 0 deletions Steps/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* The MIT License (MIT)
* Copyright (c) 2015 Microsoft
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions Steps/DataConverter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* The MIT License (MIT)
* Copyright (c) 2015 Microsoft
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 1 addition & 0 deletions Steps/DataModels/MainModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* The MIT License (MIT)
* Copyright (c) 2015 Microsoft
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 2 additions & 1 deletion Steps/LocalizedStrings.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* The MIT License (MIT)
* Copyright (c) 2015 Microsoft
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -26,7 +27,7 @@ namespace Steps
/// </summary>
public class LocalizedStrings
{
#region Variable declarations
#region Private members
/// <summary>
/// Resource instance.
/// </summary>
Expand Down
43 changes: 43 additions & 0 deletions Steps/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* The MIT License (MIT)
* Copyright (c) 2015 Microsoft
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -69,11 +70,53 @@ protected async override void OnNavigatedFrom(NavigationEventArgs e)
/// <param name="e">Provides data for non-cancelable navigation events</param>
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
await InitCore();
await App.Engine.ActivateAsync();
UpdateMenuAndAppBarIcons();
}
#endregion

private async Task InitCore()
{
if (!await StepCounter.IsSupportedAsync())
{
MessageBoxResult dlg = MessageBox.Show("Unfortunately this device does not support step counting");
}
else
{
// MotionDataSettings settings = await SenseHelper.GetSettingsAsync();
// Starting from version 2 of Motion data settings Step counter and Acitivity monitor are always available. In earlier versions system
// location setting and Motion data had to be enabled.
uint apiSet = await SenseHelper.GetSupportedApiSetAsync();
MotionDataSettings settings = await SenseHelper.GetSettingsAsync();
if (apiSet > 2)
{
if (!settings.LocationEnabled)
{
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);
if (dlg == MessageBoxResult.OK)
await SenseHelper.LaunchLocationSettingsAsync();
}
if (!settings.PlacesVisited)
{
MessageBoxResult dlg = new MessageBoxResult();
if (settings.Version < 2)
{
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);
}
else
{
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);
}
if (dlg == MessageBoxResult.OK)
await SenseHelper.LaunchSenseSettingsAsync();
else
Application.Current.Terminate();
}
}
}
}

/// <summary>
/// Executes when the Step graph finished loading.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Steps/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<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">
<Identity Name="NokiaDeveloper.StepsLumiaSensorCoreSDKsample" Publisher="CN=4AD6DA08-6C39-4A10-98CC-3243374DA59C" Version="1.1.0.2" />
<Identity Name="NokiaDeveloper.StepsLumiaSensorCoreSDKsample" Publisher="CN=4AD6DA08-6C39-4A10-98CC-3243374DA59C" Version="1.1.0.3" />
<mp:PhoneIdentity PhoneProductId="c80afab2-39d5-406a-abbe-3777e3f0b625" PhonePublisherId="5bda2eda-1ca9-45c9-9a87-77701f1fd0ca" />
<Properties>
<DisplayName>Steps – Lumia SensorCore SDK sample</DisplayName>
Expand Down
2 changes: 1 addition & 1 deletion Steps/Properties/WMAppManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Deployment xmlns="http://schemas.microsoft.com/windowsphone/2014/deployment" AppPlatformVersion="8.1">
<DefaultLanguage xmlns="" code="en-US" />
<App xmlns="" ProductID="{c80afab2-39d5-406a-abbe-3777e3f0b625}" Title="Steps – Lumia SensorCore SDK sample" RuntimeType="Silverlight" Version="1.1.0.2" Genre="apps.normal" Author="Steps author" Description="Sample description" SDOptOut="false" BackUpOptOut="false" Publisher="Steps" PublisherID="{5bda2eda-1ca9-45c9-9a87-77701f1fd0ca}" NotificationService="WNS">
<App xmlns="" ProductID="{c80afab2-39d5-406a-abbe-3777e3f0b625}" Title="Steps – Lumia SensorCore SDK sample" RuntimeType="Silverlight" Version="1.1.0.3" Genre="apps.normal" Author="Steps author" Description="Sample description" SDOptOut="false" BackUpOptOut="false" Publisher="Steps" PublisherID="{5bda2eda-1ca9-45c9-9a87-77701f1fd0ca}" NotificationService="WNS">
<IconPath IsRelative="true" IsResource="false">Assets\steps_launcher.png</IconPath>
<Capabilities>
<Capability Name="ID_CAP_NETWORKING" />
Expand Down
16 changes: 0 additions & 16 deletions Steps/Steps.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,6 @@
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="Help\LumiaSensorCoreSDK.chm" />
<None Include="Help\SensorCoreSDK.chm" />
<None Include="packages.config" />
<None Include="Properties\AppManifest.xml">
<SubType>Designer</SubType>
Expand Down Expand Up @@ -228,16 +226,6 @@
<Name>Microsoft Visual C++ 2013 Runtime Package for Windows Phone</Name>
</SDKReference>
</ItemGroup>
<ItemGroup>
<Reference Include="Lumia.Sense, Version=255.255.255.255, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\LumiaSensorCoreSDK.1.0.3.263\lib\portable-wpa81+wp81\x86\Lumia.Sense.winmd</HintPath>
</Reference>
<Reference Include="Lumia.Sense.Testing, Version=255.255.255.255, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\LumiaSensorCoreSDKTesting.1.0.3.263\lib\portable-wpa81+wp81\x86\Lumia.Sense.Testing.winmd</HintPath>
</Reference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).$(TargetFrameworkVersion).Overrides.targets" />
<Import Project="$(MSBuildExtensionsPath)\Microsoft\$(TargetFrameworkIdentifier)\$(TargetFrameworkVersion)\Microsoft.$(TargetFrameworkIdentifier).CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand All @@ -247,8 +235,4 @@
<Target Name="AfterBuild">
</Target>
-->
<ProjectExtensions />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Import Project="..\packages\LumiaSensorCoreSDK.1.0.3.263\build\wp81\LumiaSensorCoreSDK.targets" Condition="Exists('..\packages\LumiaSensorCoreSDK.1.0.3.263\build\wp81\LumiaSensorCoreSDK.targets')" />
<Import Project="..\packages\LumiaSensorCoreSDKTesting.1.0.3.263\build\wp81\LumiaSensorCoreSDKTesting.targets" Condition="Exists('..\packages\LumiaSensorCoreSDKTesting.1.0.3.263\build\wp81\LumiaSensorCoreSDKTesting.targets')" />
</Project>
8 changes: 5 additions & 3 deletions Steps/StepsEngine.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* The MIT License (MIT)
* Copyright (c) 2015 Microsoft
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -21,6 +22,7 @@
using Lumia.Sense.Testing;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
Expand All @@ -32,7 +34,7 @@ namespace Steps
/// </summary>
public class StepsEngine
{
#region Variable declarations
#region Private members
/// <summary>
/// Access to the main model of the app
/// </summary>
Expand Down Expand Up @@ -133,7 +135,7 @@ public async Task<bool> UpdateGraphAsync()
uint firstWalkingSteps = 0;
uint firstRunningSteps = 0;
List<uint> steps = new List<uint>();
for (int i = 0; i < MainModel._ArrayMaxSize; i++)
for (int i = 0; i < 200; i++)
steps.Add(0);
IList<StepCounterReading> results = null;
if (MainModel._day == 0)
Expand Down Expand Up @@ -297,7 +299,7 @@ private async Task<StepCounterReading> FirstReadingForTodayAsync()
{
// We look at the first value for today.
var results = await _stepCounter.GetStepCountHistoryAsync(DateTime.Now.Date - TimeSpan.FromDays(MainModel._day), TimeSpan.FromDays(1));
if (results != null)
if (results.Count > 0)
return results[0];
else
return null;
Expand Down
3 changes: 1 addition & 2 deletions Steps/packages.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="LumiaSensorCoreSDK" version="1.0.3.263" targetFramework="wp81" />
<package id="LumiaSensorCoreSDKTesting" version="1.0.3.263" targetFramework="wp81" />

</packages>

0 comments on commit adbb46e

Please sign in to comment.