B4J Question Bluetooth Broadcast from B4J app on RaspberryPi to B4A and B4i apps

b4x-de

Active Member
Licensed User
Longtime User
Hi,

I would like to write a B4J app that is intended to run on a raspberry pi and sends small text messages via broadcast to Android and iOS clients running a B4X app.

I would like to use BLE periodic advertising for broadcasting data. Is there any option to use it in B4J on a raspberry pi? Could some please guide me to a starting point.

Thanks, Thomas
 

b4x-de

Active Member
Licensed User
Longtime User
Thanks, for stating this clearly. For everyone with a similar problem, I put together some workaround based on the jBluetooth example provided in this post:
https://www.b4x.com/android/forum/threads/jbluetooth-library.60184/#content

I extended the B4J-Project so multiple connections can be established and maintained. Just select more than one device and click on connect. Messages are send one after another to all connected devices. (Broadcast might be more efficient.)
 

Attachments

  • B4J_BluetoothExampleMulticat.zip
    3.7 KB · Views: 201
Upvote 0

b4x-de

Active Member
Licensed User
Longtime User
If someone is interested in finding a fully functional broadcast solution the library hosted here at githup is a starting point:

https://github.com/tongo/ble-java

It is based on BlueZ the linux Bluetooth stack and can be used to compile it with d-bus Java library for raspberry pi. The contained class BleAdvertisement supports broadcasting.
 
Upvote 0
Top