I would like to create an app similar to the Starbucks app that comes with the band. I want to display bar codes. I can generate the barcodes as JPG images in the cloud or on the local device but I need to be able to display them on the band's screen. So far I have not found a way using the Band Client to display an image inside the app.
Band client has the following managers:
The closest thing I can think of is the Notification Manager that would do it but the only methods on that are:
None of which do the job. Any ideas? Right now I am thinking the SDK is just rather limited in what it can do from a UI perspective.
Bar codes are now supported in the SDK which was updated today (and a few more changes). The SDK is also out of preview woho!
new:
Here is some barcode code from the new sample app uploaded.
using (IBandClient bandClient = await BandClientManager.Instance.ConnectAsync(pairedBands[0]))
{
var myCardTextBlock = new TextBlock()
{
Color = Colors.Blue.ToBandColor(),
ElementId = 1,
Rect = new PageRect(0, 0, 200, 25)
};
var barcode = new Barcode(BarcodeType.Code39)
{
ElementId = 2,
Rect = new PageRect(0, 0, 250, 50)
};
TextBlock digitsTextBlock = new TextBlock()
{
ElementId = 3,
Rect = new PageRect(0, 0, 200, 25)
};
FlowPanel panel = new FlowPanel(myCardTextBlock, barcode, digitsTextBlock)
{
Orientation = FlowPanelOrientation.Vertical,
Rect = new PageRect(0, 0, 250, 100)
};
Guid myTileId = new Guid("D781F673-6D05-4D69-BCFF-EA7E706C3418");
BandTile myTile = new BandTile(myTileId)
{
Name = "My Tile",
TileIcon = await LoadIcon("ms-appx:///Assets/SampleTileIconLarge.png"),
SmallIcon = await LoadIcon("ms-appx:///Assets/SampleTileIconSmall.png")
};
myTile.PageLayouts.Add(new PageLayout(panel));
await bandClient.TileManager.AddTileAsync(myTile);
PageData page = new PageData(
Guid.NewGuid(),
0,
new TextBlockData(myCardTextBlock.ElementId.Value, "MY CARD"),
new BarcodeData(barcode.BarcodeType, barcode.ElementId.Value, "123456789"),
new TextBlockData(digitsTextBlock.ElementId.Value, "123456789"));
await bandClient.TileManager.SetPagesAsync(myTile.TileId, page);
this.viewModel.StatusMessage = "Done. Check the Tile on your Band (it's the last Tile).";
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With