Skip to content

Instantly share code, notes, and snippets.

@ztirom

ztirom/Band Secret

Created April 22, 2016 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ztirom/2a923390458d34e45e0b67b4ce4ac49d to your computer and use it in GitHub Desktop.
Save ztirom/2a923390458d34e45e0b67b4ce4ac49d to your computer and use it in GitHub Desktop.
First steps with Xamarin and the Microsoft Band SDK
public class Band {
private static Band BandDevice;
public BandClient BandClient { get; set; }
public String Name { get; set; }
private Band() {
}
private async void PairBand() {
var bandClientManager = BandClientManager.Instance;
var bandsFound = await bandClientManager.GetPairedBandsAsync();
if (bandsFound != null && bandsFound.Count() == 1)
{
var bandFound = bandsFound.FirstOrDefault();
BandDevice.BandClient = await bandClientManager.ConnectAsync(bandFound);
BandDevice.Name = bandFound.Name;
}
}
public static Band Instance {
get {
if (BandDevice == null)
{
BandDevice = new Band();
}
return BandDevice;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment