B4X FEED [SOLVED] Runtime BLUETOOTH_SCAN permission not working - android 12 device, targetsdk 31, android33 sdk

اطلاعات موضوع

درباره موضوع در تاریخ, در دسته b4xfeed ایجاد شده و آغاز کننده آن practicalsoftمی باشد و موضوع آن: [SOLVED] Runtime BLUETOOTH_SCAN permission not working - android 12 device, targetsdk 31, android33 sdk است. این موضوع تا کنون 29 بازدید کننده و, 0 پاسخ داشته و 0 بار پسندیده شده...
نام دسته b4xfeed
نام موضوع [SOLVED] Runtime BLUETOOTH_SCAN permission not working - android 12 device, targetsdk 31, android33 sdk
آغاز کننده موضوع practicalsoft
تاریخ شروع
پاسخ‌ها
0
بازدیدها
29
پسندها
0
آخرین ارسال توسط PracticalSoft
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] [/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...



 

عقب
بالا