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. [WEAROS] Is it possible to stop the OS from suspending App when the screen turns off?
QtWS25 Last Chance

[WEAROS] Is it possible to stop the OS from suspending App when the screen turns off?

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 2 Posters 484 Views
  • 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
    Allstar12345
    wrote on 10 Jun 2019, 16:32 last edited by
    #1

    Bit of a pickle,

    I've made myself a little Android wear (Wear OS whatever its called these days) App which plays music for personal use, now I've implemented a playlist which works fine with the screen on but once the watch turns the screen off after about 5 seconds of no touch input it seems to semi suspend the App, the music continues to play but once the track ends the QML code doesn't seem to execute until I wake the screen up by hand.

    (I can of course just force the screen to stay on with a QAndroidJniObject call but it's going to eat the already pretty bad battery twice as fast and would really be a last resort option)

    Anyone know if its possible to stop Android suspending the App so it will work properly?

    Cheers

    R 1 Reply Last reply 10 Jun 2019, 16:49
    0
    • A Allstar12345
      10 Jun 2019, 16:32

      Bit of a pickle,

      I've made myself a little Android wear (Wear OS whatever its called these days) App which plays music for personal use, now I've implemented a playlist which works fine with the screen on but once the watch turns the screen off after about 5 seconds of no touch input it seems to semi suspend the App, the music continues to play but once the track ends the QML code doesn't seem to execute until I wake the screen up by hand.

      (I can of course just force the screen to stay on with a QAndroidJniObject call but it's going to eat the already pretty bad battery twice as fast and would really be a last resort option)

      Anyone know if its possible to stop Android suspending the App so it will work properly?

      Cheers

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 10 Jun 2019, 16:49 last edited by raven-worx 6 Oct 2019, 17:20
      #2

      @Allstar12345 said in [WEAROS] Is it possible to stop the OS from suspending App when the screen turns off?:

      Anyone know if its possible to stop Android suspending the App so it will work properly?

      no, and that is for a reason.
      You should use a background service which does all the work. The UI then simply is a remote control to it's providing functionality.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      A 1 Reply Last reply 11 Jun 2019, 09:58
      3
      • R raven-worx
        10 Jun 2019, 16:49

        @Allstar12345 said in [WEAROS] Is it possible to stop the OS from suspending App when the screen turns off?:

        Anyone know if its possible to stop Android suspending the App so it will work properly?

        no, and that is for a reason.
        You should use a background service which does all the work. The UI then simply is a remote control to it's providing functionality.

        A Offline
        A Offline
        Allstar12345
        wrote on 11 Jun 2019, 09:58 last edited by
        #3

        @raven-worx Had a feeling that would be the answer, it's never going to be released so not worth the work for something I use twice a week.

        Thanks for answering :)

        1 Reply Last reply
        0

        3/3

        11 Jun 2019, 09:58

        • Login

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