Problem with scanning
See original GitHub issuehttps://github.com/msthrax/BluetoothTryApp.git (I committed the project and it is uploading, if you refer to this git and nothing was here, please just consider those file I uploaded in this note and then check this git later. thanks)
Steps to reproduce
Hi First of all, I really thank you your efforts regarding production of this library. I installed this library through nuget in my Xamarin.Forms project which include Android, iOS and UWP projects. (And also the Core project). I want to talk about Android project now and iOS and UWP platform is not my goal for now.
-
I have installed the (vanilla) package in my core and also my android project. The version is 2.2.0-pre2.
-
I tried to setup everything myself but it didn’t work, so I decided to follow this video that used this library. The link is: https://www.youtube.com/watch?v=IFRqCHLloLA (which is 4 parts)
-
Targeted Android API is 28 ( Android 9) and minimumAPI is 22 (Android 5.1).
-
I have added needed permissions in my manifest file as below: `<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.bluetoothtryapp" android:installLocation="preferExternal"> <uses-sdk android:minSdkVersion="22" android:targetSdkVersion="28" /> <application android:label="BluetoothTryApp.Android"></application> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-feature android:name="android.hardware.bluetooth_le" android:required="true" />
</manifest>`
- I have a single page that a simple “Start” button would trigger of every thing(Setting up classes, initialization and Bluetooth Scan). this is my cs code: CS File: MainPage.xaml.zip XAML file: MainPage.zip
Expected behavior
I expected to see available Bluetooth devices around my self. I connected a Bluetooth USB Dongle to my Computer and it is active and discover-able. I have another phone with enabled Bluetooth. Also i got two gadgets( one is Samsung Level U Pro and another one is a non-OS smart watch). Level U Pro is paired to my Device to check the “GetPairedDevice” functions.
Actual behavior
The thing that happened is actually nothing. But the “StateChanged” event and the “State” property were OK.
Crashlog
Nothing crashed.
Configuration
**Version of the Plugin: 2.2.0-pre2
**Platform: Android 9.0 - Pie
**Device: Samsung A70 (SM-A705FN/DS)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:9
Top GitHub Comments
Thats great @msthrax, thanks again.
I notice this allows any device that is ‘discoverable’ to be listed.
I am aware that this can be controlled in Android with the help of BluetoothAdapter.ActionRequestDiscoverable but do you happen to know how to make an ios device discoverable? Have been hunting around for the answer for quite some time.
Awesome, thanks @msthrax, will take a look! Cheers.