Hi All,
I am exploring option to connect to USB and Bluetooth for Xamarin. Forms should support Android, IOS, UWP. Please share reverent code samples
Hi All,
I am exploring option to connect to USB and Bluetooth for Xamarin. Forms should support Android, IOS, UWP. Please share reverent code samples
For bluetootu connection in xamarin forms, you can try to use following nuget package to achieve it.
https://github.com/xabre/xamarin-bluetooth-le
For demo or blog about BLE, you can Google: Integrate and use the BLE Plugin for Xamarin by Rebai Hamida
For USB connection, I cannot found Forms plugin to achieve it, but you can achieve it with dependence service for different platforms.
https://github.com/anotherlab/UsbSerialForAndroid#compatible-devices
Sample code :
adapter.ScanExtra().Subscribe(scans => {
adapter.StopScan();
scanResults = scans;
scanResults.Device.ConnectWait();
});
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH_PRIVILEGED" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.things.permission.MANAGE_BLUETOOTH" />
please let me know any thing i missed from my end
6 people are following this question.