public void StartAdapter() { CancelAllThreads(); lock (_foundDevices) { _foundDevices.Clear(); } if (Adapter.IsDiscovering) { Adapter.CancelDiscovery(); } State = BluetoothAdapterState.Created; var missingPermissions = new List <string>(); if (_activity.CheckCallingOrSelfPermission(Manifest.Permission.AccessCoarseLocation) != Permission.Granted) { missingPermissions.Add(Manifest.Permission.AccessCoarseLocation); } if (_activity.CheckCallingOrSelfPermission(Manifest.Permission.AccessFineLocation) != Permission.Granted) { missingPermissions.Add(Manifest.Permission.AccessFineLocation); } if (_activity.CheckCallingOrSelfPermission(Manifest.Permission.Bluetooth) != Permission.Granted) { missingPermissions.Add(Manifest.Permission.Bluetooth); } if (_activity.CheckCallingOrSelfPermission(Manifest.Permission.BluetoothAdmin) != Permission.Granted) { missingPermissions.Add(Manifest.Permission.BluetoothAdmin); } if (missingPermissions.Any()) { SAMLog.Warning("ABTA::MissingPerms", string.Join("|", missingPermissions.Select(p => p.Split('.').Last()))); if ((int)Build.VERSION.SdkInt >= 23) { // With API>23 I can request them here // https://blog.xamarin.com/requesting-runtime-permissions-in-android-marshmallow/ _activity.RequestPermissions(missingPermissions.ToArray(), REQUEST_ENABLE_PERM); } State = BluetoothAdapterState.PermissionNotGranted; return; } if (Adapter.IsEnabled) { State = BluetoothAdapterState.Active; } else { State = BluetoothAdapterState.RequestingEnable; Intent enableIntent = new Intent(BluetoothAdapter.ActionRequestEnable); _activity.StartActivityForResult(enableIntent, REQUEST_ENABLE_BT); } }