зеркало из https://github.com/microsoft/recorder.git
Updated to use latest Lumia SensorCore SDK 1.1 Preview
This commit is contained in:
Родитель
036b38e8e5
Коммит
aeb0ea19d0
|
@ -57,7 +57,7 @@ file the capabilities required for it to work:
|
|||
|
||||
3. Version history
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
* Version 1.1.0.3: Updated to use latest Lumia SensorCore SDK 1.1 Preview
|
||||
* Version 1.0.0.1: Some bug fixes made in this release.
|
||||
* Version 1.0: The first release.
|
||||
|
||||
|
@ -66,6 +66,7 @@ file the capabilities required for it to work:
|
|||
|
||||
| Project | Release | Download |
|
||||
| ------- | --------| -------- |
|
||||
| Recorder | v1.1.0.3 | [recorder-1.1.0.3.zip](https://github.com/Microsoft/recorder/archive/v1.1.0.3.zip) |
|
||||
| Recorder | v1.0.0.1 | [recorder-1.0.0.1.zip](https://github.com/Microsoft/recorder/archive/v1.0.0.1.zip) |
|
||||
| Recorder | v1.0 | [recorder-1.0.zip](https://github.com/Microsoft/recorder/archive/v1.0.zip) |
|
||||
|
||||
|
|
|
@ -40,11 +40,8 @@ namespace record
|
|||
{
|
||||
InitializeComponent();
|
||||
// Application version number
|
||||
var version = XDocument.Load("WMAppManifest.xml").Root.Element("App").Attribute("Version").Value;
|
||||
var versionRun = new Run()
|
||||
{
|
||||
Text = String.Format(AppResources.AboutPage_VersionRun, version) + "\n"
|
||||
};
|
||||
var ver = Windows.ApplicationModel.Package.Current.Id.Version;
|
||||
var versionRun = string.Format("{0}.{1}.{2}.{3}", ver.Major, ver.Minor, ver.Build, ver.Revision);
|
||||
VersionParagraph.Inlines.Add(versionRun);
|
||||
// Application about text
|
||||
var aboutRun = new Run()
|
||||
|
|
|
@ -314,6 +314,54 @@ namespace record
|
|||
ChangeMarkerColor(marker, rec.ItemState);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check motion data settings
|
||||
/// </summary>
|
||||
private async void CheckMotionDataSettings()
|
||||
{
|
||||
if (!(await TrackPointMonitor.IsSupportedAsync()) || !(await PlaceMonitor.IsSupportedAsync()) || !(await StepCounter.IsSupportedAsync()) || !(await ActivityMonitor.IsSupportedAsync()))
|
||||
{
|
||||
MessageBoxResult dlg = MessageBox.Show("Unfortunately this device does not support SensorCore service");
|
||||
Application.Current.Terminate();
|
||||
}
|
||||
else
|
||||
{
|
||||
uint apiSet = await SenseHelper.GetSupportedApiSetAsync();
|
||||
MotionDataSettings settings = await SenseHelper.GetSettingsAsync();
|
||||
// Devices with old location settings
|
||||
if (!settings.LocationEnabled)
|
||||
{
|
||||
MessageBoxResult dlg = MessageBox.Show("In order to recognize activities and view visited places you need to enable location in system settings. Do you want to open settings now? if no, applicatoin will exit", "Information", MessageBoxButton.OKCancel);
|
||||
if (dlg == MessageBoxResult.OK)
|
||||
await SenseHelper.LaunchLocationSettingsAsync();
|
||||
}
|
||||
if (!settings.PlacesVisited)
|
||||
{
|
||||
MessageBoxResult dlg = new MessageBoxResult();
|
||||
if (settings.Version < 2)
|
||||
{
|
||||
//device which has old motion data settings.
|
||||
//this is equal to motion data settings on/off in old system settings(SDK1.0 based)
|
||||
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);
|
||||
if (dlg == MessageBoxResult.Cancel)
|
||||
Application.Current.Terminate();
|
||||
}
|
||||
else
|
||||
{
|
||||
dlg = MessageBox.Show("In order to recognize activities you need to 'enable Places visited' and 'DataQuality to detailed' in Motion data settings. Do you want to open settings now? ", "Information", MessageBoxButton.OKCancel);
|
||||
}
|
||||
if (dlg == MessageBoxResult.OK)
|
||||
await SenseHelper.LaunchSenseSettingsAsync();
|
||||
}
|
||||
else if (apiSet >= 3 && settings.DataQuality == DataCollectionQuality.Basic)
|
||||
{
|
||||
MessageBoxResult dlg = MessageBox.Show("In order to recognize biking activity you need to enable detailed data collection in Motion data settings. Do you want to open settings now?", "Information", MessageBoxButton.OKCancel);
|
||||
if (dlg == MessageBoxResult.OK)
|
||||
await SenseHelper.LaunchSenseSettingsAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize SensorCore
|
||||
/// </summary>
|
||||
|
@ -321,7 +369,7 @@ namespace record
|
|||
/// <param name="type">Sense type</param>
|
||||
/// <returns>Asynchronous task</returns>
|
||||
private async Task HandleSensorActivity(Recording rec, SenseType type)
|
||||
{
|
||||
{
|
||||
if (rec.Recorder == null)
|
||||
{
|
||||
if (await CallSensorcoreApiAsync(async () =>
|
||||
|
@ -459,6 +507,7 @@ namespace record
|
|||
base.OnNavigatedTo(e);
|
||||
if (_recordingTimer != null && _recordingTimer.IsEnabled == false)
|
||||
_recordingTimer.Start();
|
||||
CheckMotionDataSettings();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -482,6 +531,6 @@ namespace record
|
|||
_placesRecording.Recorder = null;
|
||||
_stepsRecording.Recorder = null;
|
||||
_routeRecording.Recorder = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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="c8ccba7c-7ce1-422c-9638-6a1e02756c8d" Publisher="CN=janineva" Version="1.0.0.1" />
|
||||
<Identity Name="c8ccba7c-7ce1-422c-9638-6a1e02756c8d" Publisher="CN=janineva" Version="1.1.0.3" />
|
||||
<mp:PhoneIdentity PhoneProductId="24fef266-03b8-4bfe-b1eb-9be52472ec20" PhonePublisherId="d617d6be-6d7e-482f-8324-0a2554b13f72" />
|
||||
<Properties>
|
||||
<DisplayName>record</DisplayName>
|
||||
|
|
|
@ -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="{24fef266-03b8-4bfe-b1eb-9be52472ec20}" Title="record" RuntimeType="Silverlight" Version="1.0.0.1" Genre="apps.normal" Author="Microsoft Mobile" Description="Sample description" SDOptOut="false" BackUpOptOut="false" Publisher="record" PublisherID="{d617d6be-6d7e-482f-8324-0a2554b13f72}">
|
||||
<App xmlns="" ProductID="{24fef266-03b8-4bfe-b1eb-9be52472ec20}" Title="record" RuntimeType="Silverlight" Version="1.1.0.3" Genre="apps.normal" Author="Microsoft Mobile" Description="Sample description" SDOptOut="false" BackUpOptOut="false" Publisher="record" PublisherID="{d617d6be-6d7e-482f-8324-0a2554b13f72}">
|
||||
<IconPath IsRelative="true" IsResource="false">Assets\ApplicationIcon.png</IconPath>
|
||||
<Capabilities>
|
||||
<Capability Name="ID_CAP_NETWORKING" />
|
||||
|
|
|
@ -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>
|
|
@ -139,7 +139,6 @@
|
|||
</AppxManifest>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Help\LumiaSensorCoreSDK.chm" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\AppManifest.xml" />
|
||||
<None Include="Properties\WMAppManifest.xml">
|
||||
|
@ -185,16 +184,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.
|
||||
|
@ -204,8 +193,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>
|
Загрузка…
Ссылка в новой задаче