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:

arSsfzqjKtq2_v9Moofj4SgiWWet6WOFH-P1Z2NuxbMo4yB6yqsGaoioptbDdbMCZw4=h900



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.

Source code: https://github.com/AnywhereSoftware/B4A-Bridge
 
Last edited:

moster67

Expert
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....
 

MbedAndroid

Well-Known 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?
Tnx
 

agraham

Expert
Licensed User
Longtime User
I just tried to compile the code from GitHub to play with on my Android TV but get this error.The B4A installation is bang up to date. Any ideas what's wrong
B4A Version: 13.00
Parsing code. (0.11s)
Java Version: 19
Building folders structure. (0.03s)
Compiling code. (0.17s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
(AndroidX SDK)
Compiling resources (0.07s)
Linking resources Error
res\mipmap-anydpi-v26\ic_launcher.xml:3: error: resource mipmap/background (aka anywheresoftware.b4a.b4abridge:mipmap/background) not found.
res\mipmap-anydpi-v26\ic_launcher.xml:4: error: resource mipmap/foreground (aka anywheresoftware.b4a.b4abridge:mipmap/foreground) not found.
error: failed linking file resources.
 

teddybear

Well-Known Member
Licensed User
I just tried to compile the code from GitHub to play with on my Android TV but get this error.The B4A installation is bang up to date. Any ideas what's wrong
The source code does not include the folder res . you can find them in B4A-bridge.apk.
 

Attachments

  • res.zip
    339.9 KB · Views: 32
Top