Wish can we have B4A Bridge to install too when not in foreground ?

AnandGupta

Expert
Licensed User
Longtime User
We know that B4A Bridge installs apk from ide if it is foreground and active, in newer version of Android.

Since now we have other apps build to work in background too with some service etc., can we have B4A Bridge to install too when not in foreground ?

Actually many times I still have the installed app in foreground when I press F5 in ide, but nothing happens as B4A Bridge is in background.
I have to bring it to foreground and again press F5 to compile and install.

Regards,

Anand
 

AnandGupta

Expert
Licensed User
Longtime User
B4ABridge can install from the background but in later versions of Android the user needs to give "draw over other apps" permission for this to happen. B4ABridge should ask for this on installlation. Try uninstalling and reinstalling it.
Did not knew it. Thanks.
Will try and revert.

Regards,

Anand
 

AnandGupta

Expert
Licensed User
Longtime User
Try uninstalling and reinstalling it.
Did it. Installed from Play Store. Shows version 2.62
It did not ask for "draw over other apps" permission. Only asked 'allow to install from this source'

But same problem. Does not install apk from ide after compile, if bridge in background.

Below is my phone version, if it helps.
Android version 7.1.2
Redmi 4

Any other suggestion ?

Regards,

Anand
 

agraham

Expert
Licensed User
Longtime User
Android version 7.1.2
I thought this permission was only necessary for Android 10 and 11. If I remember correctly my Android 8 phones behaved as expected, it was only with Android 10 and 11 that I saw what you are seeing. I am afraid that I can't comment further as I have reached the limits of my knowledge and experience of this issue. Uninstalling and reinstalling after the Android system update to 10 fixed it for me.
 

AnandGupta

Expert
Licensed User
Longtime User
This is indeed not the expected behavior in Android 7. Apps were able to install from the background directly until Android 8. You can modify the source code and change line 307 in Service1:
B4X:
If Phone.SdkVersion >= 24 Then 'instead of 26
Ok, will try and revert.

Regards,

Anand
 

AnandGupta

Expert
Licensed User
Longtime User
Well made the required changes, but result same.

I am attaching below the zip of the changed Bridge source. I have add 'A' to appname etc. so that I can have both new and old one in my phone.
Also attached the images from my phone.

Screenshot_2021-04-04-16-02-52-603_anywheresoftware.b4a.b4abridgeA.jpg Screenshot_2021-04-04-15-55-19-422_b4a.GCalenadar.jpg Screenshot_2021-04-04-15-55-31-408_b4a.GCalenadar.jpg

I am trying the calendar event code below, which remains in my phone foreground,

Maybe some more changes required in the bridge code, as I noted 'SdkVersion' version check at many places in the code.

Regards,

Anand
 

Attachments

  • B4A-Bridge_A.zip
    29.4 KB · Views: 204

AnandGupta

Expert
Licensed User
Longtime User
Checked in another phone.
Android 9
Uninstalled and Installed from GPlay

Same situation.
Bridge app not coming to foreground.

Have attached the 'about phone' information, if it helps.
Screenshot_2021-04-05-18-37-24-741_com.android.settings.jpg

Regards,

Anand
 

AnandGupta

Expert
Licensed User
Longtime User
Does it fail to install when B4A-Bridge is in the background?
Yes.
The app (e.g. GCalendar) stay on and shows the last label values, not the one I changed to check.

If I again bring Bridge to foreground and again press F5 in ide, then the blue bar runs and Android prompts to install GCalendar and the latest text is show.

I am using B4A 10.60 still, if it matters.

Regards,

Anand
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I think that you are confusing different things. If you run in debug mode and see a green frame to the compilation window then B4A-Bridge doesn't need to move to the foreground. The app will be restarted automatically with the updated code.

If you are not sure whether B4A-Bridge working properly then test it in release mode. It will install every time.
 

AnandGupta

Expert
Licensed User
Longtime User
If you are not sure whether B4A-Bridge working properly then test it in release mode. It will install every time.
I am testing in release mode only.

I am talking about 'blue progress bar' in the bridge app, not green box of ide. Also in usb mode no such problem as I am not using bridge connection then.

I will try to make a video , if required, to show what I am facing. It may help better to understand.

Regards,

Anand
 
Top