Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Running Qt 5.4 on Android in the background

    Mobile and Embedded
    3
    4
    2506
    Loading More Posts
    • 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
      coder123 last edited by

      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 Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        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 Reply Quote 0
        • J
          Jonathan Z @coder123 last edited by

          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 Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            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 Reply Quote 0
            • First post
              Last post