Updated implementation, based on B4XPages of https://www.b4x.com/android/forum/threads/android-bluetooth-bluetoothadmin-tutorial.14768/#content. The code is much simpler compared to the previous example. Note that you can call Serial.Listen without making the device discoverable. This is useful...
www.b4x.com
Das Beispiel hier reicht dir nicht? Da sind alle benötigten Libraries bereits in Verwendung.
Edit: Sorry. Dachte du meintest B4A. Für B4J gibt es keine Bluetoothlibrary wenn ich das richtig in Erinnerung habe. Hab zumindest noch nie eine gesehen.
The jSerial library allows you to open and communicate with other devices through the computer COM ports. It can also be used to communicate with Bluetooth devices over a virtual com port. (jBluetooth library is now available: https://www.b4x.com/android/forum/threads/jbluetooth-library.60184/)...
This library allows you to discover and connect to Bluetooth devices. It is similar to B4A Serial library. It is based on the BlueCove open project (Apache license): http://bluecove.org/ This library runs on Windows. A modified version for Raspberry Pi is available here...