Bridge quits working

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I've been having problems with Bridge disconnecting and not responding. I haven't been able to establish any pattern for it. I think it usually happens when I'm connected to B4A but haven't compiled for a number of minutes and have had some other app running or even just had the home screen up.

Then when I try to compile, I see that it says "Disconnected" in B4A. When I touch the B4A-Bridge icon on my tablet, the Bridge screen comes up, but the buttons and other stuff don't show. If I press the Back button, nothing happens, but Home still works. I have to reboot the tablet and then restart it to ever get a connection again.

It doesn't happen very often -- not like once an hour or anything. At most, maybe once a day.

While I'm at it, I'll mention again that I keep my tablet in landscape mode but Bridge seems to be locked in portrait for some reason.
 

agraham

Expert
Licensed User
Longtime User
I keep my tablet in landscape mode but Bridge seems to be locked in portrait for some reason.
You can always recompile your own apk with both orientations allowed. You just have to change the version label Top so it doesn't get lost in landscape. B4A-Bridge source
 

agraham

Expert
Licensed User
Longtime User
I got that when I recompiled my B4A-BridgePlus apk to support both orientations. The phone library has been refactored since the original source was posted.

Process_Globals add line
Dim PhoneId As PhoneId

Service1 line 113
name = Phone.Manufacturer & " " & Phone.Model & "-" & PhoneId.GetDeviceId
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I've been working on several things while I left B4A Bridge connected, including running Designer which I connected to the tablet. After maybe a couple or 3 hours, I noticed that B4A shows "Disconnected" and Bridge on the tablet is no longer showing the buttons, etc.

I looked in the Logs and saw the Exceptions shown below repeated over and over. I tracked them back to the last logs from my app, which are the first 3 lines shown.

I've got the Log software and can send you the whole log if you want, but I'm checking first to see if this does the trick:

Log.jpg
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I got that when I recompiled my B4A-BridgePlus apk to support both orientations. The phone library has been refactored since the original source was posted.

Process_Globals add line
Dim PhoneId As PhoneId

Service1 line 113
name = Phone.Manufacturer & " " & Phone.Model & "-" & PhoneId.GetDeviceId

For future reference - when I put Dim PhoneId in Main Process_Globals, your line 113 (my 90) didn't recognize it. When I put it in Service1 Process_Globals, it did. (I don't understand why.)

Also, I had to copy the APK over on an SD card and uninstall the old version before my tablet would let me install the new one. It wouldn't write over the old one like most apps, even after a Force Close.
 

agraham

Expert
Licensed User
Longtime User
When I put it in Service1 Process_Globals, it did. (I don't understand why.)
That's expected behaviour, just like any variable if it is not declared in the local Process_Globals it would need a module name prefix when referenced.
Also, I had to copy the APK over on an SD card and uninstall the old version before my tablet would let me install the new one. It wouldn't write over the old one like most apps, even after a Force Close.
Because it was signed by a different key. The IDE warns about this when you install by B4A-Bridge.
 

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
Agraham - Thanks for the info in your last post.

Erel -

Here's another log. Sorry I'm no good at reading these myself. I had been connected, brought up Designer and connected it, worked for a while, closed Designer but forgot to disconnect, noticed that B4A was saying Disconnected.

Brought up Bridge on the tablet and it was still showing Connected. I pressed the Stop button and got an Android error saying no response. I did a Force Close (didn't have to reboot), started Bridge back up, connected in B4A and it went okay.

I thought maybe not disconnecting in Designer might have been a factor, so I started it back up, connected, closed without disconnecting and B4A was still connected, so that was not a direct cause of the B4A Disconnect, it appears.

Log20110731.png
 
Last edited:

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I tried it again, running and connecting and quitting Designer. This time B4A kept saying Connected, but I wasn't getting any unfiltered logs. I compiled my App and B4A went through all the motions, but it never appeared on the tablet. No error message from the compiler.

B4A still has the debug window open showing the broken link, but just now B4A changed to Disconnected. Bridge on the tablet is still showing Connected. When I press Stop, I get the "not responding" message.

I just tried it several more times, with and without disconnecting Designer before quitting it and got the same results every time.
 
Last edited:

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
Were you able to get anything from the logs I emailed you, or do you still need the Traces.txt file? If the latter -- could you tell me where it might be? (I couldn't find it.)
 
Top