Как получить все доступные устройства Bluetooth Android C# XamarinC#

Место общения программистов C#
Гость
Как получить все доступные устройства Bluetooth Android C# Xamarin

Сообщение Гость »

Я хочу, чтобы все устройства Bluetooth отображались в виде списка. Этот код работает в Java, но мне нужен его на C# xamarin. Помогите, пожалуйста?

Код: Выделить всё

  private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (BluetoothDevice.ACTION_FOUND.equals(action)) {
// Discovery has found a device. Get the BluetoothDevice
// object and its info from the Intent.
BluetoothDevice device =
intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
String deviceName = device.getName();
String deviceHardwareAddress = device.getAddress(); // MAC address
}
}
};

Подробнее здесь: https://stackoverflow.com/questions/453 ... rp-xamarin

Вернуться в «C#»