Scott Hanselman

Introducing Web Tiles for Microsoft Band - My diabetes data on a Band!

July 9, '15 Comments [26] Posted in Web Services
Sponsored By

Microsoft Bands in various colorsI love wearables. Check out my blog post from 11 years ago on my "Wrist.NET" Microsoft SPOT watch. This was a time before ubiquitous connectivity and it was an amazing device that provided tons of glanceable information.

Fast-forward to today and I've used a Fitbit, an Apple Watch, a few Pebble Watches, and a Microsoft Band. The thing that I wanted in 2004 - and the thing I want today - has always been an easy way to make an application for my wearable device. When the Microsoft Band (If you get one, print out this Sizing PDF first and measure your wrist) came out I immediately wanted to know what the SDK looked like! How easily could I make a new Tile on my Band?

Well, while the Band SDK is super powerful, just like the Apple Watch and most wearables, if I wanted to make a Band Tile I needed to make a mobile app first! That was a bummer for me. If I want to make a new simple Tile and share it with my friends I first need to make an app, and to have full coverage, I'll need three versions of the app (iPhone, Windows Phone, Android) as well?

The Band isn't a watch, and it's not just a pedometer. The Microsoft Band has ten sensors: an optical heart rate sensor, 3-axis accelerometer, gyrometer, GPS, light sensor, skin temp sensor, UV sensor, capacitive sensor, a microphone and one for skin response. I wanted a way to easily connect it to anything else I could think of. Lights, my glucose meter, my Nest, and on and on.

I went to the Band team and started pitching them an idea I called Web Tiles. Since every Band user already has the Microsoft Band (Health) app, why not let the existing app be a bridge and it would own new custom tiles! Web Tiles for glanceable data with a low barrier to entry, and the full Band SDK for rich interactivity. I figured we could write new Tiles with web tech. My personal use case was that I wanted a Web Tile to show my blood sugar from Nightscout, an open source app I use to manage my diabetes. Fortunately the Band Team were like-minded and we collaborated. Eventually they really started running and Web Tiles was born. You may have noticed that we gently introduced Web Tiles at the BUILD conference using my sugar data in the demo.

Web Tiles for Microsoft Band

Today the first preview version of Web Tiles is ready to go. You can make a custom Web Tile in just minutes for your Microsoft Band and install it now. You can put it on your OneDrive or blog, or even just email it to a friend.

If you're slightly technical, you can create Web Tiles with just the documentation, Notepad (or the VS Code editor) and a Zip utility. For the rest of us, you can use the online Web Tile Authoring Tool and it will generate the tile and give it to you for download.

Web Tiles are glanceable tiles that are feed by JSON, XML, or ATOM datasources. If you want to make one, feel free to use my Blood Sugar JSON datasource: http://hanselmanbanddata.azurewebsites.net and the Web Tile Authoring Tool.

The Web Tile Authoring Tool

Web Tile Authoring Tool

Otherwise, here's a little more detail. Be sure to check out the Band team's blog posts and web site!

More Technical Stuff

There is a new runtime inside the Microsoft Health app for iOS, Windows Phone, and Android to manage Web Tiles and keep them fresh. Web Tiles are a zip file with a manifest with image files and JSON inside. You can put Web Tiles anywhere on the web or in email attachments. They have a .webtile extension, but you can use the mshealth-webtile:// custom URL scheme to launch the app and download a webtile, like mshealth-webtile://?action=download-manifest&url=http://www.microsoft.com/mywebtile.webtile

A minimal Web Tile would look like this:

  • mytile.webtile (it's a renamed zip, and paths matter!)
    • /manifest.json // Contains web tile definition and references to other assets
    • /icons/*.png // PNG icons used in the web tile

Tiles can have multiple pages, in a master/detail style, binding to the data however you'd like.

image

Small Nightscout LogoTo make a Web Tile that shows my blood sugar from my Nightscout site, I created this 46x46 PNG of the Nightscout logo and pulled from the JSON feed that represents my own glucose values http://hanselmanbanddata.azurewebsites.net.

The JSON for my Diabetes Web Tile is here, as an example. You'll also find it in the How-To documentation for Web Tiles. The first part is obvious, just a manifest. Then the Tile Icon. I just have one. Then we have a single Tile with a Simple style and three lines. The format you see there "bgs[0].sgv" is a way of pulling from the JSON. Like foo.bar.baz[0] if the JSON were nested named objects. The resources are named, and then later bound in strings within pages.

You could create a Web Tile for anything you have that has a JSON endpoint. I'm going to make a Web Tile to monitor my 3D Printer using Octoprint's REST API for example.

{
"manifestVersion": 1,
"name": "Nightscout",
"description": "Nightscout Blood Sugar",
"version": 1,
"versionString": "1",
"author": "Scott Hanselman",
"organization": "Nightscout",
"contactEmail": "",
"tileIcon": {
"46": "icons/tileIcon.png"
},
"refreshIntervalMinutes": 15,
"resources": [
{
"url": "http://hanselmanbanddata.azurewebsites.net/api/Band",
"style": "Simple",
"content": {
"bgs0sgv": "bgs[0].sgv",
"bgs0bgdelta": "bgs[0].bgdelta",
"bgs0direction": "bgs[0].direction"
}
}
],
"pages": [
{
"layout": "MSBand_NoScrollingText",
"condition": "true",
"textBindings": [
{
"elementId": "1",
"value": "Sugar: {{bgs0sgv}}"
},
{
"elementId": "2",
"value": "Delta: {{bgs0bgdelta}}"
},
{
"elementId": "3",
"value": "Trend: {{bgs0direction}}"
}
]
}
]
}

I mail the Web Tile to myself and see this on my iPhone. (Again, it could be in Dropbox, OneDrive, etc)

Emailing a WebTile to myself

Now I "Open in Microsoft Health..."

Adding a Web Tile to my Band

Click Save...

Now I have 2 web tiles in my band

And I've got two new custom Web Tiles now!

IMG_2465

And here's my Band with my Web Tile installed! (Yes, at this moment in time my sugar is a little high, but I'm on it.)

In the future I'd like to see events, buttons, triggers, push notifications, inline images, charts/sparklines, and more. What do you want to use Web Ties for? Is this cool?

I'm sure the team is interested in the direction you'd like to see Web Tiles go. Interactions? Events? Real-time? More sensor support? Authentication? Sound off in the comments, vote on the Microsoft Band and Health UserVoice page and absolutely email them directly at healthms@microsoft.com.

DONATE: If you appreciate this blog and what I'm doing here, please donate to fight diabetes. Read about my story at http://hanselman.com/fightdiabetes, watch my Diabetes YouTube video, and make a tax-deductible donation here http://hanselman.com/fightdiabetes/donate

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web

VS Refactoring Essentials (formerly) NR6Pack - Free analyzers and refactoring for Visual Studio 2015

July 8, '15 Comments [21] Posted in Open Source | VS2015
Sponsored By

There are some amazing free and open source C# and VB.NET analyzers and refactorings that you can download and use now in Visual Studio 2015. Formerly called "NR6Pack" they have now be renamed VS Refactoring Essentials, a nice nod to VSWebEssentials I must say.

The best part, of course, is that since the Visual Studio Community Edition is not only FREE but also now supports extensions, that any open source or indie developer can get pack some serious power into their Visual Studio installations.

There's some interesting history here as the project and its core technology has been around for a while. It's moved from SharpDevelop into NRefactory, then NRPack, and now with the major Roslyn refactor by Mike Kr├╝ger, you've got a nice Roslyn code-base and a free extension for all called VS Refactoring Essentials.

There's lots of great refactorings, too many to include screenshots for all of them, but here's a few favorites.

Sometimes you'll dig deep into a dictionary without being defensive. VS Refactoring Essentials will notice and check the dictionary key first. Note that you'll always get a preview of what it's going to change first!

CheckDictionaryKeyValueCodeRefactoring

Conditionals can sometimes get away from you. VS Refactoring Essentials will simplify common conditionals and make them easier to read.

SimplifyConditionalTernaryExpressionAnalyzer

When setting boolean flags you'll sometimes set it, check something, and update that same flag. This refactoring will notice that and do it all on one line for you.

ConvertIfToOrExpressionAnalyzer

I never get ?: and ?? correct. VS Refactoring Essentials will help you move between ternary operators and null coalescing.

ConvertConditionalTernaryToNullCoalescingAnalyzer

FYI - This is a purely open source project that is not affiliated with Microsoft. It's part of the SharpDevelop OSS project and is MIT-licensed. Big thanks to the SharpDevelop team!

NOTE: Visual Studio 2015 will launch on July 20th. Be sure to download Visual Studio 2015 Community on that date. Until then, the V2015RC of Community is here.

Be sure to follow @VSRefactoring on twitter and thanks for them for their hard work and community focus! Go download Refactoring Essentials here for VS2015. Report issues on their GitHub.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web

Windows 10 is coming...here's what to tell non-technical parent

July 1, '15 Comments [22] Posted in Screencasts | Win10
Sponsored By

Windows 10 is coming on July 29th! I've been doing Build to Build videos on my YouTube showing what's changing and how it will affect you.

I got a request to do a video showing Windows 7, Windows 8, and Windows 10 and how to reserve your upgrade, as well as a little demo of the Start Screen. Here's that video!

NOTE: I apologize for the mediocre audio. I had a microphone failure and ended up using the laptop microphone for the last part because I was excited to get the video out. It's not representative of the quality I'm known for, and it won't happen again.

Are you the IT manager for your extended family? Will you be upgrading non-technical parent to Windows 10 or letting them do it themselves? Sound off in the comments below.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web

Lenovo Yoga 2 Pro Micro-HDMI not working? Easy fix.

June 23, '15 Comments [28] Posted in Hardware
Sponsored By

Micro HDMI sucks.This blog post is likely not for you, unless it totally is. Which is why I'm posting it.

My Dad's Lenovo Yoga 2 Pro was driving him batty for months. It was bugging me even more, as I am the assigned IT manager for my family. I'm sure you are also, as you're reading this blog, right?

Anyway, I talk this computer up for months, he gets the computer, and it has this tiny Micro-HDMI connector.

Let me just say that Micro-HDMI is the most evil of all display connectors. I mean, it literally does everything wrong.

Micro-HDMI sucks because:

  • Micro-HDMI looks like Micro USB and I can't explain to my Dad that they are different.
  • Micro-HDMI is the most fragile of all ports. If you blow on it you'll lose signal.
  • It's like the tiny shorty soda pop can of Tab. It's not Diet Coke. It's not enough. It's useless.

Which brings me to the point. His didn't work. Never worked. I tried new drivers, flashing BIOS, new cables, jiggling the connector, everything.

Except the obvious - cutting up the cable.

It turns out that many cables (especially cheap ones from Amazon) don't expose enough metal to make a decent connection.

Take a razor blade and cut a good millimeter around the cable's rubber housing to expose more metal.

Yep, I cut the cableCut around the cable. Remove 1mm or so.

Boom. It works immediately. Dad's thrilled. I'm a good son again and Micro-HDMI continues to suck as a display connector.

Full-sized HDMI or Mini-DP (Display Port) from now on, my friends.

Please, regale me in the comments with tales of why YOU too hate Micro-HDMI, Dear Reader.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web

How to use Process Monitor and Process Explorer

June 20, '15 Comments [18] Posted in Screencasts
Sponsored By

I was chatting with Phil Haack today about a weird little bug/feature we were seeing in GitHub for Windows. I don't have the source code for the application, but I wanted to explore what was going on and get some insight so I could give Phil a decent bug report.

He and I spent some time on Skype sharing screens today and he commented "we should be recording this." So I went back and did just that.

Please take a moment and Subscribe to my YouTube Channel here: http://youtube.com/shanselman

In this short video I remind folks how Procmon and ProcExp work, how powerful they are and I learn some interesting things about GitHub for Windows!

Let me know if you find short videos like these useful, and if you do, suggest topics in the comments!

Also, a reminder, if you've got non-technical family or friends who want help with Windows 8, give them a YouTube Playlist designed just for them! http://hanselman.com/windows8

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.