Share via


Introduction To Microsoft Band

This article explains about Microsoft Band and its features with a sample band connect apps using Visual Studio 2015. Weare going to discuss the Microsoft Band prerequisites and what are all the features available on Band SDK.

Microsoft Band

Microsoft Band is a smart wearable device launched by Microsoft. It allows developers to access the sensor available on the Band, and you can creat own application to track your heart rate, calories burn, exercise and so on.

The list of features of Band SDK:

  1. Support multi-platform
  2. Sensor data subscriptions
  3. Tiles creation and management
  4. Tiles notification
  5. Haptic notification
  6. Custom layouts
  7. Band theme personalization

Requirements

  1. Microsoft Band
  2. Visual Studio 2013 and above

Prerequisite

  1. Microsoft Band
  2. Microsoft Band SDK
  3. Visual Studio 2015

We can develop apps using band SDK with a different platform such as Windows, iOS, Android in the minimum requirements as in the following,

  1. Windows Phone 8.1 and above
  2. Windows 8.1 and above
  3. iOS 7 and above
  4. Android 4.2 and above

http://www.san2debug.net/image.axd?picture=%2f2016%2f01%2fmicrosoftband.jpg

**                                            Image Source: **MicrosoftStore

Steps

Step 1 

Open Visual Studio 2015 and go to file menu and point new and then click new project, where you can see the section Visual C# Template. Click Windows 8, Universal, then select Blank App (Universal Windows 8.1) and type Project Name HelloWordBandDemo, choose the project location path and then click OK button.

Go to Solution Explorer and right click the project name and then click Manage NuGet Packages.

http://www.san2debug.net/image.axd?picture=%2f2016%2f01%2fHelloWordBandDemo1.png

NuGet Package Manager window will open and you can type Microsoft Band and browse. Also select **Microsoft.Band **and click Install button.

http://www.san2debug.net/image.axd?picture=%2f2016%2f01%2fHelloWordBandDemo2.png

Preview window will open and you can see the Microsoft Band version installing details. Click OK button. License Acceptance will open and you can see the license terms and then click I Accept button.

http://www.san2debug.net/image.axd?picture=%2f2016%2f01%2fHelloWordBandDemo3.png

After it is successfully installed in Microsoft Band,you can see the following,

http://www.san2debug.net/image.axd?picture=%2f2016%2f01%2fHelloWordBandDemo4.png

You can see **HelloWordBandDemo **project structure as in the following screenshot.

http://www.san2debug.net/image.axd?picture=%2f2016%2f01%2fHelloWordBandDemo5.png

After successfully installing the Microsoft Band SDK, Double click the Package.appx manifest file then you can seen the left side information in the apps.Select the Proximity checkbox and save the package changes as in the following,

http://www.san2debug.net/image.axd?picture=%2f2016%2f01%2fHelloWordBandDemo6.png

<?xmlversion="1.0"encoding="utf-8"?> 
<Packagexmlns="http://schemas.microsoft.com/appx/2010/manifest"xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest"xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest"xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"> 
  <IdentityName="20225b23-1ba4-4c87-a2a5-2fb2e85f8f02"Publisher="CN=Santhakumar"Version="1.0.0.0"/>  
  <mp:PhoneIdentityPhoneProductId="20225b23-1ba4-4c87-a2a5-2fb2e85f8f02"PhonePublisherId="00000000-0000-0000-0000-000000000000"/>  
  <Properties> 
    <DisplayName>HelloWordBandDemo.WindowsPhone</DisplayName> 
    <PublisherDisplayName>Santhakumar</PublisherDisplayName> 
    <Logo>Assets\StoreLogo.png</Logo> 
  </Properties> 
  <Prerequisites> 
    <OSMinVersion>6.3.1</OSMinVersion> 
    <OSMaxVersionTested>6.3.1</OSMaxVersionTested> 
  </Prerequisites> 
  <Resources> 
    <ResourceLanguage="x-generate"/>  
  </Resources> 
  <Applications> 
    <ApplicationId="App"Executable="$targetnametoken$.exe"EntryPoint="HelloWordBandDemo.WindowsPhone.App"> 
      <m3:VisualElementsDisplayName="HelloWordBandDemo.WindowsPhone"Square150x150Logo="Assets\Logo.png"Square44x44Logo="Assets\SmallLogo.png"Description="HelloWordBandDemo.WindowsPhone"ForegroundText="light"BackgroundColor="transparent"> 
        <m3:DefaultTileWide310x150Logo="Assets\WideLogo.png"Square71x71Logo="Assets\Square71x71Logo.png"> 
        </m3:DefaultTile> 
        <m3:SplashScreenImage="Assets\SplashScreen.png"/>  
      </m3:VisualElements> 
    </Application> 
  </Applications> 
  <Capabilities> 
    <CapabilityName="internetClientServer"/>  
    <DeviceCapabilityName="proximity"/>  
    <DeviceCapabilityName="bluetooth.rfcomm"xmlns="http://schemas.microsoft.com/appx/2013/manifest"> 
      <DeviceId="any"> 
        <!-- Used by the Microsoft Band SDK --> 
        <FunctionType="serviceId:A502CA9A-2BA5-413C-A4E0-13804E47B38F"/>  
        <!-- Used by the Microsoft Band SDK --> 
        <FunctionType="serviceId:C742E1A2-6320-5ABC-9643-D206C677E580"/>  
      </Device> 
    </DeviceCapability> 
  </Capabilities> 
</Package>

**Step 2: **Add Microsoft Band namespace,

using Microsoft.Band;

Step 3: GetBandAsync Method

For getting the list of Microsoft Band paired to your phone device, we need to call the method GetBandsAsync() from the BandClientManager class,

IBandInfo[] bandPair = await BandClientManager.Instance.GetBandsAsync();

Step 4: Connect

Connect to the Band App paired Microsoft Band, we need to pass bandPair parameterto theConnectAsync method, 

try 
            { 
                using(IBandClient bandClient = await BandClientManager.Instance.ConnectAsync(bandPair[0])) 
                { 
                    // implement band information retreiving logic code here 
   
                } 
            } 
            catch(BandException ex)  
            { 
                // handle the band connection expection to here 
                throwex;  
            }

Conclusion

This article helps you to understand Microsoft Band and how to connect band apps using Visual Studio 2015. Thank you for reading my articles. Kindly share your comments or suggestions.