Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Running Qt 5.4 on Android in the background
Forum Updated to NodeBB v4.3 + New Features

Running Qt 5.4 on Android in the background

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 3 Posters 2.8k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    coder123
    wrote on last edited by
    #1

    I'm seeing a problem that when my Qt 5.4 app is running in the background on Android, it's not able to execute any Javascript code. Furthermore, the Timer object stops running and it seems like the Qt main thread is put on pause. I have a scenario where I have a background thread that sends a signal when a certain event is received, and upon receiving this signal in QML, I need to do some work in JS. In Qt 5.4, when your app is in the background, the signal is sent but your QML code never receives it until it goes on the foreground.

    I know in the AndroidManifest.xml, there's this line:
    <meta-data android:name="android.app.background_running" android:value="false"/>

    When I try to set it to true, my app crashes.

    It runs fine in Qt 5.3. Is Qt going to fix this issue for Qt 5.4? Is there a workaround that I can do for this issue?

    Thanks.

    J 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Sounds like a regression
      The best thing to do is check the bug report system to see if it something known. If not please consider opening a new report providing a minimal compilable example showing the behavior.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • C coder123

        I'm seeing a problem that when my Qt 5.4 app is running in the background on Android, it's not able to execute any Javascript code. Furthermore, the Timer object stops running and it seems like the Qt main thread is put on pause. I have a scenario where I have a background thread that sends a signal when a certain event is received, and upon receiving this signal in QML, I need to do some work in JS. In Qt 5.4, when your app is in the background, the signal is sent but your QML code never receives it until it goes on the foreground.

        I know in the AndroidManifest.xml, there's this line:
        <meta-data android:name="android.app.background_running" android:value="false"/>

        When I try to set it to true, my app crashes.

        It runs fine in Qt 5.3. Is Qt going to fix this issue for Qt 5.4? Is there a workaround that I can do for this issue?

        Thanks.

        J Offline
        J Offline
        Jonathan Z
        wrote on last edited by
        #3

        I have also noticed the same issue when my Qt 5.4 application is run on Android in the background:

        • A QML Timer object will pause until the application is put back to the foreground.
        • On the other hand, a QTimer object (created in C++, and not exposed to QML) still works correctly in the background.
          This appears to be a regression from Qt 5.3 to Qt 5.4. Hope this regression can be fixed in Qt 5.5.
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Did you verify if there something about it in the bug tracker ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved