Other B4A-Bridge on Android Q

Peter Simpson

Expert
Licensed User
Longtime User
Hello Erel,
So last night I received the Android Q Beta 4 update (I never installed the first 3 Betas) onto my spare phone. I wanted to test an app and also my widget.

I'm not sure if it's a Beta thing or will it work perfect in the final release, but the B4A-Bridge will only receive data and install from B4A if B4A-Bridge is actually open (Main activity is in the foreground and fully open showing buttons). If I click run (F5) in B4A and B4A-Bridge is open (showing start and top buttons), apps will always install into my spare phone running Android Q Beta 4. If I now hit the home button on my phone and then click run (F5) in B4A, the following message always occurs and B4A-Bridge will not receive any data from B4A. If I now tap on the recent apps button and tap/select B4A-Bridge then click run (F5) in B4A again, my apps will always install and the message below does not appear.

All the above is done without turning off my phone screen.

Message while using B4A-Bridge whilst the activity is in the background.

https://developer.android.com/preview/privacy/background-activity-starts

Untitled-1.jpg
 
Last edited:

agraham

Expert
Licensed User
Longtime User
Looks like Google has yet again screwed with Android with a breaking change :(. Have you read the page at the link in the error message?

It says you can disable it for testing by

Navigate to Settings > Developer options, and enable the Allow background activity starts option.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I'm familiar with this issue and it is indeed related to Google documented changes.

- Starting from Android 8 the app must be visible before it can install other apps. B4A-Bridge runs in the background and moves to the foreground right before installation starts.
- Starting from Android Q it is no longer possible to start activities from the background. I have several ideas on possible workarounds for this limit. However you can disable this restriction. Go to developer settings and look for a setting that allows activities to be started while in the background.
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Thank you all for the responses. I don't need to disable it as yet as I only installed Android Q Beta 4 for testing purposes, I'll still be coding and testing using Android P most of the time on another phone for now.

I did quickly read the link in the message, but I still decided to create this post just in case.

Actually I might disable it on that particular device for now.

Thank again.

Pete...
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Please test it. I haven't tried it yet myself.

Hello Erel,
You requested it so I've done it.
Okay I enabled 'Allow background activity starts' in developer options as stated by @agraham (thank Andrew) and yes apps are now installing like they were previously doing in Android P. B4A-Bridge is now brought to the foreground and my apps are now installing with no issues whatsoever in Android Q. The message in my screenshot above still appears but unlike before that apps are installing.
 
Last edited:
Upvote 0

techknight

Well-Known Member
Licensed User
Longtime User
Seems as if Google is choking off android more and more with each release, pretty soon I think they will be playing in Apple's territory.
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
2 months later after receiving the latest Android X 10(qpp6.190730.005) update.

Yes I know that this is an old thread of mine, but I'm continuing on from my original post.

So it looks like in the latest version of Android Q beta that I received last week on my device has stopped showing the toast message warnings in my first post (which you could bypass), Google have also removed the Allow background activity starts option from the developers options on devices.

I have an idea @Erel,
As this is clearly going to be a pain for both yourself and other developers, maybe you could update B4A and also B4A-Bridge to check if the B4A-Bridge is actually open showing the main activity. If the device is 'On' and B4A-Bridge is showing the main activity then the app will be installed as usual. If the B4A-Bridge is not showing the main activity to us the developers then maybe you could have a warning popup in the B4A IDE (a message box) letting us know to open the B4A-Bridge app on the device then try it again. A better option could be to have a warning message popup in the B4A IDE letting us know to open the B4A-Bridge app on the device and then the installation from B4A to B4A-Bridge could start automatically with the developer clicking on Run (F5) again.

What do you think Mr U?

Below is the updated information from developer.android.com.
upload_2019-8-12_16-53-47.png


Thank you Erel...
 
Upvote 0
Top