简体   繁体   中英

using Band sdk on portable class library

I'm developing a portable class library that targets Universal Windows and .Net Applications, I installed Microsoft.Band SDK from NuGet, this resolved most of the band symbols:

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

IBandInfo is accepted, but BandClientManager raises an error:

The Name BandClientManager does not exist in the current context

Both Symbols are from the SDK, any reason one is defined, while the other is not resolved?

The BandClientManager type is specific to the platform on which the Band SDK is being used (eg Windows Phone or Windows Store), due (in part) to differences in the Bluetooth API between platforms. It's not portable so it cannot be used directly from a Portable Class Library that targets multiple platforms.

Instead, you need to limit your use of the Band SDK in your PCL to the IBandClientManager interface, which is portable. Then, your platform-specific library can inject the appropriate BandClientManager.Instance at runtime.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM