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. How to enable signals while Android app is in background

How to enable signals while Android app is in background

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 3 Posters 1.1k Views 1 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.
  • A Offline
    A Offline
    Andreas E.
    wrote on last edited by
    #1

    Hello,

    I am trying to integrate VoIP Push Notifications in my app, so I can handle incoming connections. However, while the app is not in the foreground I cannot process any signals with Qt. It seems as if all signals emitted through queued connections are dropped (direct connections work, but are useless because Firebase runs in a different thread). Is there any way to temporarily activate regular signal processing while in background?

    Thanks a lot.

    jsulmJ 1 Reply Last reply
    0
    • A Andreas E.

      Hello,

      I am trying to integrate VoIP Push Notifications in my app, so I can handle incoming connections. However, while the app is not in the foreground I cannot process any signals with Qt. It seems as if all signals emitted through queued connections are dropped (direct connections work, but are useless because Firebase runs in a different thread). Is there any way to temporarily activate regular signal processing while in background?

      Thanks a lot.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Andreas-E. I think you will need to implement a background service. Not active applications are stopped, so event loop is stopped.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      5
      • A Offline
        A Offline
        Andreas E.
        wrote on last edited by
        #3

        Thank you, using a service came to my mind, but would be quite difficult to integrate. Currently I am using

        <meta-data android:name="android.app.background_running" android:value="true"/>
        

        in the Android manifest which keeps the event loop running in background.

        J.HilkJ 1 Reply Last reply
        0
        • A Andreas E.

          Thank you, using a service came to my mind, but would be quite difficult to integrate. Currently I am using

          <meta-data android:name="android.app.background_running" android:value="true"/>
          

          in the Android manifest which keeps the event loop running in background.

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          hi @Andreas-E.
          you should investigate that further, because from my experience, all apps without background service eventually get suspended from non rooted devices.

          That includes apps with the manifest change

          <meta-data android:name="android.app.background_running" android:value="true"/>

          with this change, it will just take longer until the app becomes suspended


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          A 1 Reply Last reply
          2
          • J.HilkJ J.Hilk

            hi @Andreas-E.
            you should investigate that further, because from my experience, all apps without background service eventually get suspended from non rooted devices.

            That includes apps with the manifest change

            <meta-data android:name="android.app.background_running" android:value="true"/>

            with this change, it will just take longer until the app becomes suspended

            A Offline
            A Offline
            Andreas E.
            wrote on last edited by
            #5

            Hi @J-Hilk
            I only need background operation for a short time after receiving an FCM data notification. I would expect the app to be woken up by the system in this case? But I'm still not sure if this will also wake up the event loop.

            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