java.lang.SecurityException:UID 10457 / PID 24525 缺少权限 android.permission.BLUETOOTH
Android 应用程序给出:
java.lang.SecurityException: UID 10457 / PID 24525 lacks permission android.permission.BLUETOOTH
当我尝试在小米 android 12 中使用 BluetoothDevice().connect() 连接蓝牙打印机时,
我尝试连接蓝牙热敏打印机,但无法在 android 12 中执行此操作
Android app giving:
java.lang.SecurityException: UID 10457 / PID 24525 lacks permission android.permission.BLUETOOTH
When I try to connect with Bluetooth printer using BluetoothDevice().connect() in Xiaomi android 12
I am trying to connect with Bluetooth thermal but am not able to do it in android 12
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先您必须添加用户权限。
然后你的代码,你必须检查用户是否使用Android 12。如果是,检查权限蓝牙。然后就可以使用蓝牙了。
这里的例子我使用这里的库。 https://github.com/Karumi/Dexter
First you have to add user-permission.
And then your codes, you have to check if the user is using Android 12. If yes, check the permission Bluetooth. And then you can able to use the Bluetooth.
Example here I use library from here. https://github.com/Karumi/Dexter