Wearable devices are very famous nowadays. Microsoft band is one of them. Currently, Microsoft Band 2 is in the market with a price of $249.99. Microsoft Band comes with a number of sensors, including GPS sensor for footstep counts, heart beat monitoring and many more. If you want to develop apps for Microsoft Band while having no band, you would not test your apps without Microsoft Band till today. But now it is not a problem.
You can test you your apps without Band.
Fake Band is available now. Fake Band enables you to test you Band apps without Band. Fake Band is a library for developing and testing Band apps without connecting to physical Band device.
Steps are quite simple.
Step 1: Download and Install the
Band SDK.
Step 2: Create a UWP project in Visual studio.
Step 3: Get the Fake Band.
Write the following command in Package Manager console of Visual Studio,
Step 4: Now, you are able to use the FakeBand library. The following code snippet helps you to understand the working.
- FakeBandClientManager.Configure(new FakeBandClientManagerOptions
- {
- Bands = new List<IBandInfo>
- {
- new FakeBandInfo(BandConnectionType.Bluetooth, "Fake Band 1"),
- new FakeBandInfo(BandConnectionType.Bluetooth, "Fake Band 2"),
- }
- });
-
-
- IBandClientManager clientManager = FakeBandClientManager.Instance;
-
-
- var bands = await clientManager.GetBandsAsync();
- var bandInfo = bands.First();
-
- var bandClient = await FakeBandClientManager.Instance.ConnectAsync(bandInfo);
- var meTile = await bandClient.PersonalizationManager.GetMeTileImageAsync();
-
- var wb = meTile.ToWriteableBitmap();
- MeTileImage.Source = wb; //MeTileImage is the name of Image XAML control
- var uc = bandClient.SensorManager.Accelerometer.GetCurrentUserConsent();
- bool isConsented = false;
-
- if (uc == UserConsent.NotSpecified)
- {
- isConsented = await bandClient.SensorManager.Accelerometer.RequestUserConsentAsync();
- }
-
- if (isConsented || uc == UserConsent.Granted)
- {
- bandClient.SensorManager.Accelerometer.ReadingChanged += async (obj, ev) =>
- {
- await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
- {
-
- });
- };
-
- await bandClient.SensorManager.Accelerometer.StartReadingsAsync();
- }
Run the project
More