Other B4A-Bridge on Android Q

Discussion in 'Android Questions' started by Peter Simpson, Jun 6, 2019.

  1. Peter Simpson

    Peter Simpson Expert Licensed 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: Jun 6, 2019
  2. DonManfred

    DonManfred Expert Licensed User

    You are using which B4A Version, Peter?
    Just want to make sure you are using a recent version as it may be relevant.
     
    Last edited: Jun 6, 2019
  3. Peter Simpson

    Peter Simpson Expert Licensed User

    Hiya Manfred,
    The latest B4A V9.01.1 and Bridge V2.55. On Android P everything works 100% perfect as expected, but this only started happening on Android Q, I'm running Beta 4.
     
    DonManfred likes this.
  4. DonManfred

    DonManfred Expert Licensed User

    as written i just wanted to make sure you use this version.

    Ok, seems to be a new issue for @Erel.
     
    Peter Simpson likes this.
  5. agraham

    agraham Expert Licensed 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.
     
    Peter Simpson likes this.
  6. Erel

    Erel Administrator Staff Member Licensed 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.
     
    Peter Simpson likes this.
  7. Peter Simpson

    Peter Simpson Expert Licensed 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...
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    Please test it. I haven't tried it yet myself.
     
    Peter Simpson likes this.
  9. Peter Simpson

    Peter Simpson Expert Licensed User

    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: Jun 6, 2019
    Erel likes this.
  10. techknight

    techknight Well-Known Member Licensed 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.
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    Thank you Peter. This is good.
    The message itself will not appear after the beta.
     
  12. Peter Simpson

    Peter Simpson Expert Licensed 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...
     
  13. Erel

    Erel Administrator Staff Member Licensed User

    It will be managed in some way. Maybe with a notification to make it easy to move it to the foreground. There are other possible solutions that I need to check.
     
    Peter Simpson likes this.
  14. Erel

    Erel Administrator Staff Member Licensed User

  15. Peter Simpson

    Peter Simpson Expert Licensed User

    Last edited: Sep 5, 2019
    peacemaker and DonManfred like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice