Image display in Microsoft Band

I would like to create an application similar to the Starbucks application, which is part of a group. I want to display barcodes. I can create barcodes as JPG images in the cloud or on a local device, but I need to be able to display them on a group screen. So far, I have not found a way to use Band Client to display the image inside the application.

The client of the group has the following managers:

  • Notification manager
  • Personalization manager
  • Style manager
  • Sensor Manager

The closest thing I can think of is the Notification Manager, which will do this, but the only methods that are:

  • SendMessageAsync
  • ShowDialogAsync
  • Vibrateasync

None of them do this work. Any ideas? Now I think that the SDK is simply limited in what it can do in terms of the user interface.

+6
source share
3 answers

Now, the barcodes that have been updated (and a few more changes) are now updated in the SDK. SDK is also out of sight woho!

new

  • Rich Content Snippets - Barcodes and Icons
  • List item
  • We can have buttons! (can't believe i was worried about the button)
  • We can listen to events with tiles and buttons.
  • Access New Data Calories
  • Windows phone background support.
  • remote or local iOS notifications

Here are a few barcodes from the uploaded new sample application.

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 the last Tile)."; } 
+4
source

Currently, the Microsoft Band SDK Preview does not have the ability to create custom layouts for fragments. Your observations are correct, you can create a tile to which you can send messages, and the last message (according to their timestamps) will be displayed in the tile.

+1
source

There is a way. This is very complex and limited to a certain data size.

An icon can be uploaded to your plates (in fact, up to 8, I think).

Icons should be transparent PNG size 48x48.

For a QR code, this means that it has a white image where the black parts of the QR code are transparent.

enter image description here

Above image 1 . If you color black alpha, use webqr for example, then you can check and see that it works. (I cannot demonstrate using PNG, because SO does not like transparency).

Loading this strip into the usual one for the icon (see the manuals), except that you need to set the ColorSource to custom and the Color to (255,255,255) white.

I was able to successfully download and scan this in my Band.

However, I would note that it is not particularly convenient for the user, since the icon is so small on the strip that the scanner may have problems with its selection.

I will send feedback to MS, because I think it will be a very useful feature, and the introduction of QR codes should be trivial for them.

0
source

Source: https://habr.com/ru/post/983267/


All Articles