I am new to Xamarin but have been using c# for some time. I started attempting to create a list of all nearby Bluetooth devices but am not sure if there are plugins required or if there is a simple way to do this. All I need to receive is the Bluetooth identity.
Thanks in advance
This would be best posted in Cross Platform with Xamarin or Xamarin.Forms category depending on whether you are developing using Xamarin.Forms or not.
Linking some possible help assuming Xamarin.Forms.
There is another discussion of that here:
https://forums.xamarin.com/discussion/79699/is-there-a-bluetooth-example-for-xamarin-forms-shared
There is a third party plugin also, mentioned in the discussion linked above:
https://www.nuget.org/packages/Plugin.BLE/
https://github.com/xabre/xamarin-bluetooth-le
If not using Xamarin Forms, then you can just implement your BLE functionality using the Native BLE APIs in Xamarin.Android/Xamarin.iOS/Xamarin.Mac.
Answers
@bleari
This would be best posted in Cross Platform with Xamarin or Xamarin.Forms category depending on whether you are developing using Xamarin.Forms or not.
Linking some possible help assuming Xamarin.Forms.
There is another discussion of that here:
https://forums.xamarin.com/discussion/79699/is-there-a-bluetooth-example-for-xamarin-forms-shared
There is a third party plugin also, mentioned in the discussion linked above:
https://www.nuget.org/packages/Plugin.BLE/
https://github.com/xabre/xamarin-bluetooth-le
If not using Xamarin Forms, then you can just implement your BLE functionality using the Native BLE APIs in Xamarin.Android/Xamarin.iOS/Xamarin.Mac.
Where I can find an example of using Native BLE API for Xamarin.Android?
@JGoldberger I'd also like to know where to find a recent example for the Xamarin native BLE API for android
@lstempek, @eubik
I found an older blog post with sample code and app: https://elbruno.com/2015/09/08/vs2015-listing-bluetooth-le-devices-in-android-with-xamarin/
You can also look for samples in Java and just port to Xamarin.Android. generally porting from Android Java code to Xamarin.Android C# code is not too difficult.
Also using the API docs may help. Here are the API docs for the Android.Bluetooth.LE Namespace: https://developer.xamarin.com/api/namespace/Android.Bluetooth.LE/
All of the classes that you need for interacting with Bluetooth LE device in Xamarin.Android are in that namespace.
moving to Cross platform with Xamarin category.
@JGoldberger Thanks for the links!
Unfortunately the blog post only talks about scanning and doesn't cover connecting or interacting with services or characteristics. The github link to all the sample code in that post is dead as well
Sorry about that, but the API docs should be helpful. I would suggest going through the docs, finding what you need and asking specific questions if you do not understand something or need help getting a specific thing to work.