3d-tiles 数据加载_为Microsoft Band引入Web Tiles-我在一个Band上的糖尿病数据!

3d-tiles 数据加载

3d-tiles 数据加载

I 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.

我喜欢可穿戴设备。 查看我11年前在“ Wrist.NET” Microsoft SPOT手表上的博客文章。 这是无处不在的连接之前的时间,这是一个令人惊叹的设备,可提供大量的一览无余的信息。

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?

快进到今天,我已经使用了Fitbit,Apple Watch,一些Pebble Watch和Microsoft Band。 我在2004年想要的东西-今天想要的东西-一直是为可穿戴设备申请应用程序的简便方法。 当Microsoft Band (如果有的话,请先打印出此Sizing PDF并测量您的手腕)问世,我立即想知道SDK的外观! 如何轻松在乐队上制作新的图块?

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?

好吧,尽管Band SDK超级强大,就像Apple Watch和大多数可穿戴设备一样,如果我想制作Band Tile,我需要先制作移动应用程序! 对我来说真是太可惜了。 如果我想制作一个新的简单Tile并与我的朋友分享,我首先需要制作一个应用程序并具有完整的覆盖范围,我还需要该应用程序的三个版本(iPhone,Windows Phone,Android)吗?

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.

手环不是手表,也不是计步器。 Microsoft Band具有十个传感器:光学心率传感器,3轴加速度计,陀螺仪,GPS,光传感器,皮肤温度传感器,UV传感器,电容传感器,麦克风和一个用于皮肤React的传感器。 我想要一种轻松地将其连接到其他任何我能想到的方式的方法。 灯光,我的血糖仪,我的Nest等等。

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.

我去了Band团队,开始向他们介绍一个叫做Web Tiles的想法。 由于每个Band用户都已经拥有Microsoft Band(运行状况)应用程序,为什么不让现有应用程序成为桥梁,而它将拥有新的自定义图块! Web Tiles提供了低访问障碍的可浏览数据,以及完整的Band SDK,可提供丰富的交互性。 我认为我们可以使用网络技术编写新的Tiles。 我个人的用例是,我想要一个Web Tile来显示Nightscout的血糖,该软件是我用来管理糖尿病的开源应用程序。 幸运的是,乐队团队志同道合,我们进行了合作。 最终,他们真正开始运行,Web Tiles诞生了。 您可能已经注意到,我们在演示中使用我的糖数据在BUILD会议上轻轻介绍了Web Tiles

微软乐队的网络瓷砖 (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.

今天,第一个Web Tiles预览版已准备就绪。 您可以在短短几分钟内为Microsoft Band制作一个自定义Web Tile,然后立即安装。 您可以将其放在OneDrive或博客上,甚至可以通过电子邮件发送给朋友。

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.

如果您是技术人员,可以只使用文档,记事本(或VS Code编辑器)和Zip实用程序来创建Web Tiles。 对于我们其他人,您可以使用在线Web Tile Authoring Tool ,它将生成磁贴并将其提供给您下载。

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.

Web Tiles是可浏览的tile,由JSON,XML或ATOM数据源提供。 如果您想创建一个,请随时使用我的Blood JSON数据源: http : //hanselmanbanddata.azurewebsites.netWeb Tile Authoring Tool

Web Tile创作工具 (The 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!

否则,这里有更多细节。 请务必查看Band团队的博客文章和网站!

更多技术资料 (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

Microsoft Health应用程序内部有一个适用于iOS,Windows Phone和Android的新运行时,用于管理Web Tiles并使它们保持最新状态。 Web Tiles是一个zip文件,其中包含清单,其中包含图像文件和JSON。 您可以将Web Tiles放在网络上的任何位置或电子邮件附件中。 它们具有.webtile扩展名,但是您可以使用mshealth-webtile://自定义URL方案来启动应用程序并下载webtile,例如mshealth-webtile://?action = download-manifest&url = http:// www。 microsoft.com/mywebtile.webtile

A minimal Web Tile would look like this:

最小的Web Tile如下所示:

  • mytile.webtile (it's a renamed zip, and paths matter!)

    mytile.webtile(这是一个重命名的zip,路径很重要!)

    • /manifest.json // Contains web tile definition and references to other assets

      /manifest.json //包含网络图块定义和对其他资产的引用
    • /icons/*.png // PNG icons used in the web tile

      /icons/*.png //网络图块中使用的PNG图标

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

切片可以以主/明细样式包含多个页面,并根据需要绑定到数据。

Small Nightscout Logo

To 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.

为了制作一个显示我的Nightscout网站上的血糖的Web Tile,我创建了这个Nightxout徽标的46x46 PNG,并从代表我自己的葡萄糖值的JSON feed中提取了http://hanselmanbanddatadata.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.

例如,我的Diabetes Web Tile的JSON。 您还将在Web Tiles的“操作方法”文档中找到它。 第一部分很明显,只是一个清单。 然后是平铺图标。 我只有一个。 然后我们有一个具有简单样式和三行的图块。 您在其中看到的格式“ bgs [0] .sgv”是从JSON中提取的一种方式。 如果JSON是嵌套的命名对象,则类似于foo.bar.baz [0]。 资源被命名,然后被绑定在页面内的字符串中。

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.

您可以为拥有JSON端点的任何对象创建Web Tile。 例如,我将制作一个Web Tile,以使用Octoprint的REST API监视我的3D打印机

{
"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)

我将Web Tile邮寄给自己,并在iPhone上看到了。 (同样,它可能在Dropbox,OneDrive等中)

Emailing a WebTile to myself

Now I "Open in Microsoft Health..."

现在,我“在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!

现在,我有了两个新的自定义Web Tiles!

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.)

这是我的乐队,其中安装了我的Web Tile! (是的,此刻我的糖分有点高,但我坚持下去。)

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?

将来,我希望看到事件,按钮,触发器,推送通知,嵌入式图像,图表/火花线等。 您想将Web Ties用于什么? 这很酷吗?

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.

我确定团队对您希望Web Tiles前进的方向感兴趣。 互动? 活动? 即时的? 更多传感器支持? 认证? 取消评论中的声音,在Microsoft Band and Health UserVoice页面上投票,并绝对直接通过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

捐赠如果您欣赏此博客以及我在这里所做的事情,请捐赠抗击糖尿病。 在http://hanselman.com/fightdiabetes上了解我的故事,观看我的Diabetes YouTube视频,并在http://hanselman.com/fightdiabetes/donate进行免税捐赠。

翻译自: https://www.hanselman.com/blog/introducing-web-tiles-for-microsoft-band-my-diabetes-data-on-a-band

3d-tiles 数据加载

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值