Android Tutorial B4A-Bridge source code

Erel

Administrator
Staff member
Licensed User
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.
 

Attachments

Last edited:

metrick

Active Member
Licensed User
Erel:
Thank you.
Can you also provide the code for IDE Tools->B4A Bridge->Connect and Disconnect? Would like to know how it all ties together. Thanks.
 

joedarock

Member
Licensed User
I'm running Bridge Ver 2.00 and B4A Ver 1.9. When I attempt to connect via the Bluetooth bridge, the IDE hangs up and can only be reset by Task Manager. My phone (Droid Incredible 2) is paired to the PC's Bluetooth modem and that pairing works for other apps I've written.

Suggestions??
Joe
 

manios

Active Member
Licensed User
IDE may lock up

Erel,
I am running B4A Ver 1.9. I do not have any Bluetooth device on my PC.
Yesterday I hit accidently Connect Bluetooth and the IDE did lock up. Had to kill the application with the task manager. Unfortunately I lost some code I was working on.
Would it be possible to deselect the menuitem for Bluetooth?
 

Erel

Administrator
Staff member
Licensed User
The interaction with the Bluetooth driver is done by a third party library. It is not expected to hang the IDE. Even if there is no Bluetooth device available. We will further investigate this issue.
 

alvinmb

Member
Licensed User
Bridge issue in 1.9 Bluetooth hands IDE

I'm having major issues with the IDE and using the Bluetooth bridge.
I establish a connection with the device and IDE, compile and the new package gets delivered to the phone, at which point the compile message box will not allow me to use the close button, and the IDE locks up. The only way out is to use task manager to kill the IDE.
 

Jondroid

Member
Licensed User
Hi Erel,
thanks for the updated version of the bridge. The version which I installed from the market is version 2.01 but the source code above is version 2.00 according to the source code.

What are the differences between 2.01 and 2.00?

Many thanks in advance,
Jondroid
 

Erel

Administrator
Staff member
Licensed User
The only difference is that version 2.01 was compiled with the updated Network library (which fixes an issue related to wifi IP addresses).
 

reijndert

Member
Licensed User
b4a bridge

Hi Eril.
Can you put the most recent b4a source in the thread.
I want to recompile because of my ics-style ROM (BroodKernel and BroodROM) on my 2.3.6 android phone.
Dark thema and getting black text on darkgrey buttons...

I tried modifying this but i ended up with a 2.00 version.

Thanks in advance.
 

Attachments

Erel

Administrator
Staff member
Licensed User
Done. The version is actually v2.10 as it includes a small fix that was not included in v2.09 (in the manifest editor).
 

mr23

Active Member
Licensed User
b4a has:
#VersionCode: 9
#VersionName: 2.09
Dim version As String = "2.10"
Manifest has:
android:versionCode="9"
android:versionName="2.09"

Intentional?
 

Erel

Administrator
Staff member
Licensed User
It will be updated when v2.10 is released to Google Play.
 
Top