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/)
The attached examples implement an Android <-> PC chat app.
In order to run the example you need to first pair the PC and the device and make sure that the Bluetooth is mapped to a virtual com port.
jSerial works with AsyncStreams. Both standard mode and prefix mode are supported.
Note that prefix mode can only work if both sides of the connection follow the protocol.
Change AStream.InitializePrefix to AStream.Initialize to disable prefix mode.
jSerial depends on an open source project named JSSC:
http://code.google.com/p/java-simple-serial-connector/ (the jar file is included in the zip file).