1

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

  • Can you describe the behavior? Does the app not install, crash, or Bluetooth doesn't connect? – James H Jul 06 '16 at 23:12
  • App is installed, but when I click on enable bluetooth, nothing happens. – Archana Kulkarni Jul 07 '16 at 06:03
  • I had your same problem, and have since discovered the solution. Do NOT just take the .CN1lib file from the repository. Instead use this process to install the extension: https://www.codenameone.com/cn1libs.html – EvSunWoodard Jul 19 '16 at 16:44

2 Answers2

1

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

Chen
  • 3,760
  • 1
  • 17
  • 21
  • I tried your solution, but getting same errors. Enable blutooth does nothing and manual start produces same errors even when I have json lib installed and refreshed. – Archana Kulkarni Jul 08 '16 at 04:36
  • That error indicates the json classes are missing,I'd suggest you to try again on a clean new project and add the 2 cn1libs – Chen Jul 09 '16 at 06:58
  • As you suggested, I tried it on fresh project, but problem persists. Its not enabling bluetooth neither scanning devices nearby on manual start. – Archana Kulkarni Jul 09 '16 at 08:39
  • Try to update the Bluetooth lib to the latest cn1lib version – Chen Jul 13 '16 at 09:30
  • To fix it, instead of downloading the cn1lib file from the repo, I just did the install from the extensions page. It worked well after that. https://www.codenameone.com/cn1libs.html – EvSunWoodard Jul 19 '16 at 16:45
0

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.

Community
  • 1
  • 1