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?
Forum Updated to NodeBB v4.3 + New Features

[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 528 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
    Allstar12345
    wrote on 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

    raven-worxR 1 Reply Last reply
    0
    • A Allstar12345

      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

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by raven-worx
      #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
      3
      • raven-worxR raven-worx

        @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 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

        • Login

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