GithubHelp home page GithubHelp logo

bandontherun / fake-band Goto Github PK

View Code? Open in Web Editor NEW
38.0 7.0 12.0 378 KB

Library to enable programming against the Microsoft Band SDK without connecting to a physical band

Home Page: http://peted.azurewebsites.net/fake-microsoft-band/

License: MIT License

C# 100.00%

fake-band's Introduction

Fake Band

alt tag

Library to enable programming against the Microsoft Band SDK without connecting to a physical band See http://peted.azurewebsites.net/fake-microsoft-band/ for further details and usage

From the package manager console in Visual Studio

Install-Package FakeBand

Then you can use the library like this example:

  FakeBandClientManager.Configure(new FakeBandClientManagerOptions
  {
      Bands = new List<IBandInfo>
      {
          new FakeBandInfo(BandConnectionType.Bluetooth, "Fake Band 1"),
          new FakeBandInfo(BandConnectionType.Bluetooth, "Fake Band 2"),
      }
  });

  // Use the fake band client manager
  IBandClientManager clientManager = FakeBandClientManager.Instance;

  // Microsoft Band SDK code
  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;

Where MeTileImage is a XAML image control

Or this example to subscribe for sensor data:

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, () =>
        {
            // Update User Interface...
        });
    };

    await bandClient.SensorManager.Accelerometer.StartReadingsAsync();
}

fake-band's People

Contributors

peted70 avatar corsairmarks avatar

Stargazers

Media Explorer avatar  avatar ๐Ÿ’Œ avatar Alexander avatar  avatar Sun Fei avatar Ian Savchenko avatar Billy Idle avatar Peter Dunshee avatar  avatar Matt Dendura avatar ArenasCats avatar Prajjwal avatar Jani Turunen avatar Sasha Imamovich avatar David Gristwood avatar Callon Campbell avatar Dean Ellis avatar  avatar Nino Benvenuti avatar  avatar Jesper Larsen-Ledet avatar El Bruno avatar Ehsan Sajjad avatar Santhakumar Munuswamy avatar Phil Horne avatar Antti Kuntsi avatar Sebastian Schubotz avatar Nukepayload2 avatar Romeo Pavoni avatar Nino Benvenuti avatar Jason avatar Scenevista avatar Kirill Basin avatar Drew Naylor avatar  avatar Yurui Zhou avatar Gary Ewan Park avatar

Watchers

James Cloos avatar  avatar David Gristwood avatar Jani Turunen avatar pedro pablo malagon amor avatar Ehsan Sajjad avatar Media Explorer avatar

fake-band's Issues

TypeLoadException in FakeBandClientManager with latest Band Nuget Package 1.3.20217

When using the latest Microsof.Band Nuget Package 1.3.20217
there is a TypeLoadException when using FakeBandClientManager:

An exception of type 'System.TypeLoadException' occurred in BandApp1.exe but was not handled in user code

Additional information: Method 'GetBandsAsync' in type 'FakeBand.Fakes.FakeBandClientManager' from assembly 'FakeBand, Version=0.0.8.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

This problem does not occur with earlier versions (<= 1.3.20115) of the Microsoft.Band Nuget Package.

Adding the following Code to the App Constructor triggers the TypeLOadException on Debugging Startup (x86 - Local Machine)

FakeBand.Fakes.FakeBandClientManager.Configure(
                new FakeBand.Fakes.FakeBandClientManagerOptions() {
                    Bands = new List<IBandInfo>() {
                        new FakeBand.Fakes.FakeBandInfo(BandConnectionType.Bluetooth, "Fake Band 1", FakeBand.Fakes.BandVersion.BandTwo)
                    }
                });

FakeBand is not compatible with Xamarin.Android (Mono)

FakeBand or one of its direct dependencies have strong dependency on Google.Protobuf that makes it incompatible with Xamarin.Android.
If its aligned with the goals of this project this issue/task is to ensure that Fake.Band works with Xamarin.Android out of the box

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.