-1

Checked so far : this stack post, this one and official docs

I am not really familiarised with the Bluetooth api, yet I couldn't find something to clarify based on my need.

What I am trying to achieve is: Using my android device (as server in this bluetooth connection) to push data to the other device (which can be on any platform) Seems simple, and I might think about it in a complicate way (was thinking I might provide some interfaces / callbacks to the client part)

Also, my implementation should not affect the client side.. I am a bit stuck into this, if anyone could clarify it a bit, or come up with a decent sample where the code is described a bit,

Thanks in advance, and Happy Coding !

Ionut J. Bejan
  • 734
  • 11
  • 28

1 Answers1

0

your phone can act as a master(host) device Here is a example you can implement

https://github.com/bauerjj/Android-Simple-Bluetooth-Example

this example uses Bluetooth to connect with HC-06 module but you can use it with other devices

Mahan
  • 11
  • 3
  • Ok, I tried the example in your answer, tried to understand it a bit.. The problem is that it's not connecting to any device. After some debugging, I noticed that there is a socket timeout exception thrown. Something doesn't seem right .. – Ionut J. Bejan Dec 12 '19 at 13:52
  • can you tell me on which line the exception occurs? also check this link https://stackoverflow.com/a/42579911/11814068 – Mahan Dec 14 '19 at 10:40