After a couple of post on how to connect and use C# to access a Microsoft Band information, today’s post will explain about how we can work with the Tiles of in a Band using C# code. In the references section, there are a couple of links explaining how Tiles works in in a Band. In this post I will explain the most important actions we have to work with Tiles
- We will use the TileManager class to work with Tiles
- With this class, you will be able
- get the custom Tiles added to the Band
- add a Tile
- delete a Tile
- find out the available space to add Tiles
Let’s start with an easy sample
Add or remove a Tile
The essential features that we have to define the moment of creating a Tile are
- Id (guid) to identify the Tile
- A name for the Tile
- 2 images to identify it, 24 x 24 pixels and 46 x 46 pixels
For this example, the images that I will use will be the following:
And the code to add a Tile is as follows.
- 142 to 150 lines, defines the Tile, and also the contents of the
- Lines 152 to 152, removed the Tile (if it exists) and then add the Tile with your content
At this time, we will see that it starts the process of synchronization between the app on Windows 10 and the band. This starts with a notification in the Band while the Tile is removed:
And confirmation on the App to add this tile to the Band.
Once the process is finished, you will see the new Tile between the band.
The elimination, only shows the synchronization and then we will see that the tile is no longer between the Band.
List the Tiles custom in the Band
To list the tiles custom, also we will use the TileManager class. The following example shows a Message Dialog with the data of the Tiles custom.
The message of example shown would be the following
And that’s all for today, in the next few posts we will see how to work with a user interactions in a Tile.
GitHub source code: https://github.com/elbruno/Blog/tree/master/MSBand/App1
Saludos @ Madrid
- Microsoft Band Get Started
- Microsoft Band SDK
- Microsoft Band Tiles
- Microsoft Band Experience Design Guidelines
- El Bruno, How to connect a Microsoft Band to a Windows 10 device
- El Bruno, How to connect to a Band and access sensor information in a Windows 10 app using Visual Studio 2015