douglasjunior / AndroidBluetoothLibrary

A Library for easy implementation of Serial Bluetooth Classic and Low Energy on Android. 💙
MIT License
224 stars 68 forks source link

Does not work connect to device #32

Closed daimonkor closed 1 year ago

daimonkor commented 5 years ago

I can not connect two devices (current sample kotlin). http://prntscr.com/m12p6r

Tested https://github.com/ybenannoune/BluetoothPong works normal (used classic https://github.com/googlesamples/android-BluetoothChat/blob/master/Application/src/main/java/com/example/android/bluetoothchat/BluetoothChatService.java ) Thanks for help.

jjrodcast commented 5 years ago

I think that currently the library just support to connect one device. @douglasjunior could give you more details about that

daimonkor commented 5 years ago

I think that currently the library just support to connect one device. @douglasjunior could give you more details about that

Yes, I tested server/client devices (first - server, second - client), can not connect

douglasjunior commented 5 years ago

@jjrodcast is right. The library was created to connect to devices like thermal printers, arduino, and others devices with serial communication.

daimonkor commented 5 years ago

ok, step by step:

  1. compile and install sample kotlin on first device
  2. compile and install sample kotlin on second device
  3. start application at both devices
  4. start scan on first device
  5. turn to connect to my found device and shown toast with "NONE" message.

I used BluetoothClassicService.class, I found it is the same with bluetooth chat class and the same with my tested app (ping pong). But ping pong network part works, current library sample does not work. I removed apk, removed pairs, reboot devices, no work https://prnt.sc/m12p6r

douglasjunior commented 5 years ago

This is the problem, this library will not work with two smartphones, because this library not work in "server mode", only in "client mode".

daimonkor commented 5 years ago

I am trying only connect two devices, classic scenario. I think that BluetoothClassicService.class confirm my idea. Tested the same service https://github.com/ybenannoune/BluetoothPong/blob/master/android/src/com/mygdx/game/BluetoothService.java and works normal. You are right http://prntscr.com/m15t9z . Yes, jabra bluetooth connected. Please provide server mode. Thanks for help.

GPla commented 4 years ago

This is the problem, this library will not work with two smartphones, because this library not work in "server mode", only in "client mode".

It would be nice, if you could add that to the project description.