Android Question How to implement a Service that Receives String Data and send Over Bluetooth

EduardoElias

Well-Known Member
Licensed User
Longtime User
Hi there,

The title says it most.

What I need is to have the Service running in background and listening to some port (this is over wifi) and when receives de data it will send it over bluetooth.

It is basically a way to relay data (text) to another device. Eventually I could send some header to select the proper bluetooth to relay to if there is more than one connected.

What is the best protocol to do this? I have experienced UDP with b4a and it works, but it can be lost easily. I dont need anything too fancy.

Any tip will be much appreciated

Eduardo
 

EduardoElias

Well-Known Member
Licensed User
Longtime User
Primarily a PC, it will send most of the time text and esc/p commands that needs to be relayed to a bluetooth printer. It is not very intensive use. I am giving a try with UDP, that I have already in place.

I was thinking after reading many posts if TCP (serversocket) should be enough?

I took a look on httpserver either, but I think it is too much for a simple task.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…