Codenameone Bluetooth APIs not working on android

淺唱寂寞╮ 提交于 2021-02-19 07:43:24

问题


I have downloaded BluetoothDemo from https://github.com/chen-fishbein/bluetoothle-codenameone. I created APK file using codename one build server and install it on my android mobile. Its not working. Is there any way to fix it?

Can I run the same from netbeans using AVD manager or something similar to that so that I can debug it myself?

If I started bluetooth manually, following is error on mobile phone on click of initialize or start scan option-

Error snapshot attached


回答1:


You need to also add the https://github.com/shannah/CN1JSON/ cn1lib and install it using the codenameone-refresh cn1libs action




回答2:


If you are running Android 7.x. you will also need to make sure that 'Location' is enabled in the App settings, otherwise the behaviour will be exactly the same as described in the question. See this comment. Codenameone provides a setting for permissions in their build hints with ACCESS_COARSE_LOCATION but that does not seem to work on my Nexus 6P with Android 7.1. I had to enable it manually.



来源:https://stackoverflow.com/questions/38226601/codenameone-bluetooth-apis-not-working-on-android

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!