ble.net icon indicating copy to clipboard operation
ble.net copied to clipboard

BluetoothLowEnergyAdapter does not exist

Open Andufer opened this issue 5 years ago • 3 comments

Hi, I'm trying this package just now, so I'm at the beginning. Asd suggested, I'm adding in Android MainActivity:

BluetoothLowEnergyAdapter.InitActivity(this);

and

protected sealed override void OnActivityResult(Int32 requestCode, Result resultCode, Intent data) { BluetoothLowEnergyAdapter.OnActivityResult(requestCode, resultCode, data); }

But BluetoothLowEnergyAdapter does not exist.

Where I'm wrong?

Thanks a lot and have a nice day. Andrea

Andufer avatar May 23 '19 13:05 Andufer

I've resolved installing ble-android and ble-ios manually. Now I'm using prism and I don't understand how to obtain a reference to BluetoothLowEnergyAdapter. Can you help me?

Thanks, Andrea

Andufer avatar May 23 '19 16:05 Andufer

The readme has enumerated steps for getting started. https://github.com/nexussays/ble.net/blob/master/Readme.md#3-initialize-bluetoothlowenergyadapter-android-only

It seems you've done step 3 and are on step 4 where you obtain the adapter in your platform code with BluetoothLowEnergyAdapter.ObtainDefaultAdapter()

I'm not familiar with Prism, but you can pass that adapter reference around as needed and put it into a dependency injection system or whatever Prism does.

Hope that helps. Best of luck, -malachi

On Thu, May 23, 2019 at 9:20 AM Andufer [email protected] wrote:

I've resolved installing ble-android and ble-ios manually. Now I'm using prism and I don't understand how to obtain a reference to BluetoothLowEnergyAdapter. Can you help me?

Thanks, Andrea

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nexussays/ble.net/issues/72?email_source=notifications&email_token=AABFR4CVQA5ZTEJLC23MFNLPW275DA5CNFSM4HPES6B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWCX36I#issuecomment-495287801, or mute the thread https://github.com/notifications/unsubscribe-auth/AABFR4ASFOIVIGFCRH7QFI3PW275DANCNFSM4HPES6BQ .

nexussays avatar May 24 '19 05:05 nexussays

BluetoothLowEnergyAdapter seems to be part of the platform-specific projects, e.g. ble.net-android. Can anyone show me, where I can find this platform-specific code? The nugets are here, but not the code. Thanks

thomasgalliker avatar Jun 12 '19 07:06 thomasgalliker