- Jun 6, 2020
- 11,559
- 4,422
Hello,
I followed the instructions here to try to make the bluetooth scan work on Android 12 device with app targeted for API level 31.
[H3]
Updated implementation, based on B4XPages of
However, even though the permission is added in the manifest and access_fine_location permission is requested in runtime in the code, I'm getting the below error in logcat, and the program crashes. I don't get typical Android nearby_devices permission dialog box.
Am I missing something? Is there a function to request runtime permission just like location? Similar to this:
B4X:
Thanks
Android SDK used - Android 33:
platforms\android-33\android.jar
Logcat error:
B4X:
I followed the instructions here to try to make the bluetooth scan work on Android 12 device with app targeted for API level 31.
[H3]
برای دیدن لینک ها باید ثبت نام کنید
[/H3]Updated implementation, based on B4XPages of
برای دیدن لینک ها باید ثبت نام کنید
. The code is much simpler compared to the previous example. Note that you can call Serial.Listen without making the device discoverable. This is useful...
برای دیدن تصاویر باید ثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید
However, even though the permission is added in the manifest and access_fine_location permission is requested in runtime in the code, I'm getting the below error in logcat, and the program crashes. I don't get typical Android nearby_devices permission dialog box.
Am I missing something? Is there a function to request runtime permission just like location? Similar to this:
B4X:
rp.CheckAndRequest(rp.PERMISSION_BLUETOOTH_SCAN)
Thanks
Android SDK used - Android 33:
platforms\android-33\android.jar
Logcat error:
B4X:
12-11 23:59:12.123 18500 18500 E AndroidRuntime: java.lang.SecurityException: Need android.permission.BLUETOOTH_SCAN permission for AttributionSource { uid = 10702, packageName = X, attributionTag = null, token = android.os.BinderProxy@b1e0deb...
برای دیدن لینک ها باید ثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید