标签: microsoft-band

无法通过蓝牙从Windows运行时组件连接到Microsoft频段

我正在开发一个Windows Phone 8.1应用程序,它与Microsoft Band连接以发送一些通知.我需要执行一些后台任务,所以我添加了一个Windows运行时组件项目.

我从后台任务发送通知,即从Runtime组件项目发送通知.但是我收到了一个错误.错误如下:

错误: System.TypeInitializationException:'Microsoft.Band.Store.StoreResources'的类型初始值设定项引发异常.---> System.Exception:在Microsoft.Band.Store.StoreResources..cctor()的Windows.UI.Xaml.Application.get_Current()中发生灾难性故障(来自HRESULT的异常:0x8000FFFF(E_UNEXPECTED))---结束内部异常堆栈跟踪---在Microsoft.Band.Store.Bore.BluetoothTransport的Microsoft.Band.Store.BluetoothTransport.GetTransport(RfcommDeviceService服务,ILoggerProvider loggerProvider,UInt16 maxConnectAttempts)的Microsoft.Band.Store.StoreResources.get_RfComm_FromId_ReturnedNull()处. System_Threading.Tasks.Task.Execute()中的System.Threading.Tasks.Task`1.InnerInvoke()处于c__DisplayClass1.b__0()

正如本问题的答案所述,前台应用程序在后台应用程序尝试连接时不应尝试连接到乐队.

  • 我的前台应用程序不是尝试连接也没有与乐队有任何联系.

我认为错误是连接到蓝牙的问题,因为我已经调试并找出了错误的位置:

public async void Run(IBackgroundTaskInstance taskInstance)
    {
        var deferral = taskInstance.GetDeferral();

        try
        {
            Debug.WriteLine("Task Triggered " + DateTime.Now);
            taskInstance.Canceled += (s, e) => { };
            taskInstance.Progress = 0;

            // Get the list of Microsoft Bands paired to the phone.
            var pairedBands = await BandClientManager.Instance.GetBandsAsync();
            if (pairedBands.Length < 1)
            {
                Debug.WriteLine(
                    "This sample app requires a Microsoft Band …
Run Code Online (Sandbox Code Playgroud)

.net c# bluetooth windows-phone-8.1 microsoft-band

9
推荐指数
1
解决办法
715
查看次数

尝试呈现其视图不在窗口层次结构中的UIViewController

我有一个具有以下层次结构的多视图应用程序:

splash - >导航控制器 - >表视图控制器 - >设置视图控制器

Splash是应用程序入口点,因此成为根视图控制器.当我尝试通过设置视图控制器上的操作向乐队添加磁贴时,我收到调试器警告:

application [1929:1000746]警告:尝试在<SplashViewController:0x15dd597b0>上显示<MSBAddTileDialogViewController_iOS:0x15f0575b0>,其视图不在窗口层次结构中!

这在调用后立即发生MSBClient.tileManager addTile:completionHandler:.调用永不返回,不会产生错误.

有关如何绕过这个的任何建议?

cocoa-touch ios microsoft-band

8
推荐指数
1
解决办法
2428
查看次数

iOS:保持与乐队的连接

我在应用程序商店中有2个应用程序,在MS Band上有Tiles-(乐队时间跟踪器和乐队列表).这两个都遇到了同样的问题:随着时间的推移,与频段的连接丢失,Band中生成的事件不会触发应用程序上的代码执行.

我可以使用哪些类型的缓解策略来确保事件始终触发手机上的代码执行?

现在我唯一包含的是触觉反馈来通知用户该事件已被接受.

ios microsoft-band

8
推荐指数
0
解决办法
163
查看次数

从microsoft health API检索数据

我想在microsoft health api中访问我的帐户.我已按照步骤访问访问令牌.我在徘徊的是获取我的帐户信息的最后步骤是什么?我定义了几个参数,我有一个重定向URI,一个访问令牌,密码,用户ID,范围.如何使用它们才能访问我的帐户数据?

如何使用我之前步骤中收到的访问令牌对我的帐户进行身份验证,以便访问API?

在文档中,有一个有效GET请求的示例:

GET /v1/me/Profile HTTP/1.1 
Authorization: bearer EwCoAvF0BAAUkWhN6f8bO0+=
Run Code Online (Sandbox Code Playgroud)

我应该做什么要求.我不确定我是否理解这个例子.我想做:

http://myurl.com/v1/me/Profile HTTP/1.1 
Authorization: bearer "access token"
Run Code Online (Sandbox Code Playgroud)

但是我收到了一条消息

网页未找到

.

c# microsoft-band

8
推荐指数
1
解决办法
544
查看次数

访问Microsoft Band SDK(PC和Android)

因此,我目前正在开展一项使用多人生理数据的研究项目,并计划使用Microsoft Band这样做,我很惊讶今天的消息已经停止使用Band并且SDK不再可用.

然而,由于研究项目仍有相当大的希望,我仍然希望这样做,并且需要你们的开发人员的帮助.有人会非常友好地与我分享最新版本的PC和Android SDK吗?

我非常感谢你对此事的帮助.

sdk android pc microsoft-band

8
推荐指数
1
解决办法
1654
查看次数

在Microsoft Band上显示图像

我想创建一个类似于乐队附带的星巴克应用程序的应用程序.我想显示条形码.我可以在云端或本地设备上生成条形码作为JPG图像,但我需要能够在乐队的屏幕上显示它们.到目前为止,我还没有找到使用Band Client在应用程序内显示图像的方法.

乐队客户有以下经理:

  • 通知经理
  • 个性化经理
  • 瓷砖经理
  • Sensor Manager

我能想到的最接近的事情是通知管理器会做到这一点,但唯一的方法是:

  • SendMessageAsync
  • ShowDialogAsync
  • VibrateAsync

这些都不起作用.有任何想法吗?现在我认为SDK从UI的角度来看它的功能相当有限.

microsoft-band

6
推荐指数
1
解决办法
772
查看次数

如何检测Microsoft Band版本

目前我正在执行以下操作来检测用户拥有的Microsoft Band模型:

FirmwareVersion = await SelectedBand.GetFirmwareVersionAsync();
BandModel = int.Parse(FirmwareVersion.Split('.')[0])< 10 ? 2 : 1;
Run Code Online (Sandbox Code Playgroud)

这种方法的原因是因为Band 1固件的版本高于Band 2的版本.从工程角度来看这是有道理的,但是一旦Band 2达到10+,就可能导致冲突

  • Band 1使用10.xxx
  • Band 2使用2.xxx

有一个更好的方法吗?有没有人找到更准确的Band模型标识符?

注意:我也会使用SelectedBand.GetHardwareVersionAsync()它返回一个与Band模型无关的整数.

c# microsoft-band uwp

6
推荐指数
1
解决办法
166
查看次数

Microsoft Band SDK部署错误:发布中的ARM:原始错误代码:2148733978

尝试使用Microsoft Band SDK部署应用程序时出现以下错误.构建配置是RELEASE,目标输出是ARM.如果使用DEBUG配置,它可以工作.

Error : DEP6810 : MdilXapCompile.exe failed with error code 2001.
Run Code Online (Sandbox Code Playgroud)

我检查了MDILXapCompileLog,以下是编译失败的地方:

CrossGen failed 
Error processing assembly [projectpath]...\obj\ARM\Release\MSIL\Microsoft.Band.dll
Raw error code: 2148733978
Run Code Online (Sandbox Code Playgroud)

注意:关于这种情况的额外奇怪的部分是,如果我只是在没有部署的情况下打包应用程序,我可以将其侧载到设备并且它按预期工作.

以下是csproj部分 - Debug/ARM:

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
Run Code Online (Sandbox Code Playgroud)

发布/ ARM

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_PHONE_APP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
Run Code Online (Sandbox Code Playgroud)

我看到的唯一区别是调试符号,Microsoft.Band.dll可能没有公共符号吗?是不是Visual Studio应该创建它们?

winrt-xaml windows-phone-8.1 microsoft-band

5
推荐指数
1
解决办法
1472
查看次数

从微软乐队获得心率

我试图从微软乐队获得心率.只要值发生变化,它就应该更新.然后我试图在a中显示该值TextBlock.我首先创建一个实例IBandClient,并设置其HeartRate.ReadingChanged方法如下:

bandClient.SensorManager.HeartRate.ReadingChanged += HeartRate_ReadingChanged;
Run Code Online (Sandbox Code Playgroud)

然后我尝试像这样更新值:

private void HeartRate_ReadingChanged(object sender, Microsoft.Band.Sensors.BandSensorReadingEventArgs<Microsoft.Band.Sensors.IBandHeartRateReading> e)
{
    HeartRate = e.SensorReading.HeartRate;
}
Run Code Online (Sandbox Code Playgroud)

HeartRate是这样的一int组:

public int HeartRate
{
    get { return (int)GetValue(HeartRateProperty); }
    set { SetValue(HeartRateProperty, value); }
}

// Using a DependencyProperty as the backing store for HeartRate.  This enables animation, styling, binding, etc...
public static readonly DependencyProperty HeartRateProperty =
    DependencyProperty.Register("HeartRate", typeof(int), typeof(MainPage), new PropertyMetadata(0));
Run Code Online (Sandbox Code Playgroud)

TextBlock随后的文字必然HeartRate.但是,我在尝试设置时不断收到此错误HeartRate:

该应用程序调用了一个为不同线程编组的接口.(来自HRESULT的异常:0x8001010E(RPC_E_WRONG_THREAD))

我的猜测是它正在尝试设置,HeartRate而它仍然是从之前的通话中设置的.

c# windows-phone-8.1 microsoft-band

5
推荐指数
1
解决办法
623
查看次数

Microsoft乐队无需使用移动设备即可实时获取数据

我已经购买了微软乐队.我的范围是使用该设备以实时跟踪步骤和心率等信息.我在游荡有没有办法让这些数据实时无需第三台设备直接上电脑,例如使用蓝牙设备?是否有文件系统才能在Band设备中存储数据?我怎样才能存储我的数据,例如我在外面而且我没有移动支持?

编辑:我从网站下载了示例代码.现在,我在使用模拟器的设备运行项目时遇到问题.在这两种情况下,我都收到自举设备失败.找不到设备.在模拟器的情况下,我收到以下错误:

Error   2   Error : DEP6200 : Boostrapping 'Emulator 8.1 U1 qHD 5 inch' failed. Device cannot be found. The configuration data for this product is corrupt. Contact your support personnel.
Personalization.WindowsPhone
Run Code Online (Sandbox Code Playgroud)

如何将设备与我的应用配对?我已经使用微软同步应用程序将设备与PC配对.

Edit2:我创建了一个Windows运行时应用程序,然后我按照上面提到的链接进行了操作.我设法从代码中找到配对设备.如何使用配对设备读取心率?

我的代码如下:

     IBandInfo[] bandsPaired = await BandClientManager.Instance.GetBandsAsync();
     IBandClient bandClient = await BandClientManager.Instance.ConnectAsync(bandsPaired[0]);

      if (bandClient.SensorManager.HeartRate.GetCurrentUserConsent() != UserConsent.Granted)
      {

         await bandClient.SensorManager.HeartRate.RequestUserConsentAsync();
      }
Run Code Online (Sandbox Code Playgroud)

我该怎么做才能将心率作为整数值?有没有办法将项目导入统一?

bluetooth microsoft-band

5
推荐指数
2
解决办法
577
查看次数