How do I keep app alive on Android while game is unfocused?

0 favourites
  • 9 posts
From the Asset Store
Easily integrate Telegram Mini Apps SDK into your Construct 3 projects for building interactive apps and games.
  • Hi!

    I uploaded an example of a multiplayer chat.

    Added an action: send a message every 10 seconds.

    Then I exported it to android (I didn't choose "Pause on unfocus").

    After I minimize (collapse, make app not active, choose another app) the application, messages stop being sent.

    How do I fix this?

    I need to keep app alive after collapse the application.

    Tagged:

  • The last time I looked at this was a couple years ago, 2018ish. Back then it was an Android problem that they were going to fix (supposedly soon). You might check the forums and see it there is now something you can put in your config file to fix the pause on unfocus. That's almost always a browser issue.

  • My standard response is: don't do that, it will waste the device battery. Why do you need to send a message on a regular basis? If you need to do something like simulate the passage of real-world time in a game, then you can just measure the time between the app suspending and resuming, and simulate that much time passing, allowing the device to save battery in between.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • There is a run in background plugin you can use.

  • My standard response is: don't do that, it will waste the device battery. Why do you need to send a message on a regular basis? If you need to do something like simulate the passage of real-world time in a game, then you can just measure the time between the app suspending and resuming, and simulate that much time passing, allowing the device to save battery in between.

    I need to do an in-game chat.

    To do this, I took an example of a multiplayer chat.

    But if you are absent from the chat for 10 minutes, the chat closes. And if the chat is minimized, then messages do not come to it.

    How do I solve this problem?

    P.S. There is a bug in the chat itself.

    If you turn off the Internet and then turn it on, you will need to restart the app to enter the chat. Because the app thinks that I am IN the room, but NOT connected to the server and NOT logged in.

    Some kind of paradox :)

    read more about this bug here: construct.net/en/forum/construct-3/how-do-i-8/leave-room-mutliplayer-chat-164494

  • There is a run in background plugin you can use.

    Can you write more details? I don't know what you're talking about.

  • > There is a run in background plugin you can use.

    Can you write more details? I don't know what you're talking about.

    construct.net/en/make-games/addons/462/run-background/ace

    Dont know if it will work in ur case tho.

  • > > There is a run in background plugin you can use.

    >

    >

    > Can you write more details? I don't know what you're talking about.

    https://www.construct.net/en/make-games/addons/462/run-background/ace

    Dont know if it will work in ur case tho.

    The server returned an HTTP 404 error. That requested URL could not be found.

  • > > > There is a run in background plugin you can use.

    > >

    > >

    > > Can you write more details? I don't know what you're talking about.

    >

    >

    > construct.net/en/make-games/addons/462/run-background/ace

    >

    >

    > Dont know if it will work in ur case tho.

    The server returned an HTTP 404 error. That requested URL could not be found.

    C3 Website is weird today or its my work net, im sorry link is construct.net/en/make-games/addons/462/run-background

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)