You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So this thing works on Windows 11 (in some form or the other, I made a few modifications to get that 32feet thing working at all). But it fails on Android 12 on a Samsung S10e. I get an exception:
Java.Lang.SecurityException: 'Need android.permission.BLUETOOTH_SCAN permission for AttributionSource ...'
I checked that my manifest file was showing properly and the main activity code was actually executed. I saw that the code only requests Bluetooth permission so I duplicated it for the BluetoothScan permission, but that doesn't change anything. My app requires Bluetooth permission and requests it but still doesn't have it. Did you account for that in the demo somewhere?
The MainActivity.Android.cs file also has several calls underlined in green in Visual Studio that I don't understand. What is that version "M"? I have version 12 and it is executed (stepped through in the debugger).
The demo source code in this repo looks outdated anyway, it has a completely different project structure than what I get when I create a new project. But I can read everywhere that Uno is developing much quicker than its documentation could keep up with, causing a lot of issues for beginners who want to follow the tutorials and documentation. Maybe you should slow down a little and focus on documentation so that this stuff actually becomes usable by others. You want others to use it, right? At least your website makes that impression.
The text was updated successfully, but these errors were encountered:
Looks like the code has a bug. I found this and translated it to C#. The difference is that the code wasn't requesting all permissions but only one.
This is what works for me:
publicclassMainActivity:Microsoft.UI.Xaml.ApplicationActivity{protectedoverridevoidOnCreate(Bundlebundle){base.OnCreate(bundle);RequestBluetoothPermissions();}privatevoidRequestBluetoothPermissions(){// TODO: Somehow set minimum Android version to 6.0 (or "23")if(CheckSelfPermission(Manifest.Permission.Bluetooth)!=Permission.Granted){RequestPermissions([Manifest.Permission.Bluetooth,Manifest.Permission.AccessFineLocation,Manifest.Permission.BluetoothScan,Manifest.Permission.BluetoothConnect],1);}}}
This has triggered a permission confirmation that I had to accept. Then the app was able to receive BLE advertisements.
(Unfortunately that 32feet library has other issues on its own limiting its use severely. Can't there be something built in to .NET/Uno for such elementary communication like Bluetooth that exists on every phone?)
Edit: Sorry, I noticed that this repo is for all samples. I'm talking about this one: https://platform.uno/blog/building-a-bluetooth-explore-with-uno-platform/
So this thing works on Windows 11 (in some form or the other, I made a few modifications to get that 32feet thing working at all). But it fails on Android 12 on a Samsung S10e. I get an exception:
Java.Lang.SecurityException: 'Need android.permission.BLUETOOTH_SCAN permission for AttributionSource ...'
I checked that my manifest file was showing properly and the main activity code was actually executed. I saw that the code only requests
Bluetooth
permission so I duplicated it for theBluetoothScan
permission, but that doesn't change anything. My app requires Bluetooth permission and requests it but still doesn't have it. Did you account for that in the demo somewhere?The MainActivity.Android.cs file also has several calls underlined in green in Visual Studio that I don't understand. What is that version "M"? I have version 12 and it is executed (stepped through in the debugger).
The demo source code in this repo looks outdated anyway, it has a completely different project structure than what I get when I create a new project. But I can read everywhere that Uno is developing much quicker than its documentation could keep up with, causing a lot of issues for beginners who want to follow the tutorials and documentation. Maybe you should slow down a little and focus on documentation so that this stuff actually becomes usable by others. You want others to use it, right? At least your website makes that impression.
The text was updated successfully, but these errors were encountered: