Apps, Coding, How to, MicrosoftBand, Windows Phone

Streaming Sensor data from the Microsoft Band using Reactive Extensions and C#

Hi,

So I’ve recently been working on programming for the Microsoft Band. In particular looking at streaming sensor data back from the band in realtime to process on my Windows Phone phone and, depending on the data, push up to a cloud service.

Out of the box the Band SDK will give you a set of SensorManagers to which you can hook up .NET EventHandlers and then do what you will with the output.

However, working with streams of data in .NET using EventHandlers is a pain and there is a much nicer technology for dealing with streams -> Reactive Extensions. (It’s a pretty bit topic, if you haven’t heard of it I’d strongly recommend reading up and having a play.)

So I set about writing a little wrapper to take the input from the Band’s SensorManagers and create an IObservable stream of events.

This lets you do awesome stuff, like doing linq queries over the realtime data stream or time based operations, among other things.

Continue reading

Standard
Coding, How to, Windows Phone, Windows Store

Windows Phone 8.1 – Create a Draw control like Android NavigationDraw

Hi,

This is something I wanted to do with my HypeMix app, the aim was that the user would be able to navigate around the app but, on any page, open the draw to see the currently playing track etc.

Luckily, now Windows Phone 8.1 is in line with WinRT, we have the idea of Frames for Navigation.

Using this I created a FramePage, this is the first page the app navigates to and it contains the Draw Content, Frame (for subsequent pages we navigate to) and some animations for show and hide.

Once my custom FramePage has loaded it sets up the app so all navigation happens inside this page, which contains the draw overlay.

As there are quite a few moving parts, rather than copy and paste LOADS of snippets, I’ve put the whole thing up on GitHub for you to play with.

https://github.com/lawrencegripper/WindowsPhone8–NavigationDrawerExample

Ps. Quick and dirty demo hacked together from the actual app, no lovely UI, just some nice bright colors to demonstrate different panels and pages. In my app I’ve combined this with a pub/sub model and a navigation service to avoid the code behind and make things a bit nicer, left out of this demo to aid simplicity.

Hopefully this is useful to others!

 

 

 

Standard