Android Tutorial B4A-Bridge source code

B4A-Bridge is made of two components. One component is running on the device and the other is embedded in the IDE.
The device side is the server side. It waits for connections and when a connection is established it handles the "action" messages.

The code itself is made of a simple activity:


And a service that is doing most of the job.
All the network communication is handled by an AsyncStreams object. AsyncStreams are very useful for networking and other external communication.

In this case the AsyncStreams object is initialized in prefix mode. In this mode we always receive complete messages which makes things simpler.
See this tutorial for more information: AsyncStreams Tutorial

This code is a good example for networking and working with service.
You are welcomed to examine the code and ask any question about it.

Latest version source code is attached.


    29.5 KB · Views: 454
Last edited:


Licensed User
Longtime User
I might be wrong but it seems to me that the file "B4A-BridgeLastVersionWithBluetooth" in the first post does not contain the bluetooth-code....


Active Member
Licensed User
Longtime User
It's possible to update the source to latest version (2.60) OR add the multiscreen attribute in the manifest?