英文:
Permission BLUETOOTH for Android 13 in kivy app
问题
我是一个初学者的Kivy用户。我制作了一个通过蓝牙在移动设备上显示Arduino数据的应用程序。我在buildozer.spec中允许访问如下:
android.permissions = BLUETOOTH_ADMIN,BLUETOOTH
这个应用程序之前运行得很好,但现在无法在我的安卓设备上运行。我收到了以下错误:
JVM异常发生:需要android.permission BLUETOOTH CONNECT权限用于AttributionSource(uid-10316包名org test.myapp,属性标签-null,令牌android.os.BinderProxy@df550d7,下一个null):Adapter Service getBondedDevices java.lang.securityException
我该如何修复这个错误?
我的应用程序在Android 11及以下版本上运行正常,但在我的Android版本为13的手机上无法运行。
在此提前感谢您的帮助。
英文:
I am a beginner Kivy user. I made an app that displays Arduino data on mobile via Bluetooth. I allow access in buildozer.spec as follows:
android.permissions = BLUETOOTH_ADMIN,BLUETOOTH
The app worked well ,but now it can't run on my android. I get an error like below:
JVM exception occurred : Need android.permission BLUETOOTH CONNECT permission for AttributionSource ( uid - 10316 packageName org test.myapp , attribution Tag- null , token android.os.BinderProxy@df550d7 , next null ) : Adapter Service getBondedDevices java.lang.securityException
How do I fix this error?
My app works fine on Android 11 and below but it doesn't work on my mobile which its Android is 13.
Thank you in advance for your help
答案1
得分: 1
from android.permissions import request_permissions, Permission
request_permissions([Permission.BLUETOOTH_CONNECT, Permission.BLUETOOTH_SCAN ])
英文:
Add this code to your main.py program:
from android.permissions import request_permissions, Permission
request_permissions([Permission.BLUETOOTH_CONNECT,Permission.BLUETOOTH_SCAN ])
答案2
得分: 0
在 Android 12 及以上版本,您需要请求用户授予BLUETOOTH_SCAN
和BLUETOOTH_CONNECT
权限。在 Android 12 以下版本,您需要请求ACCESS_FINE_LOCATION
权限。
英文:
In android 12 above You need to ask from the user
BLUETOOTH_SCAN
and BLUETOOTH_CONNECT
permission both.
under android 12 you need to ask ACCESS_FINE_LOCATION
permission
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论