Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

  • 0
Sign in to follow this  
Srejon_Khan

How to run code when game is not running in Unity c#

Question

Hey there, is there any way in unity (Android) to have some code running in the background while you are not using the game?

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

No, it's not possible to "run" any code inside any application without it actually running. Applications that run in the background without a visible icon is just that, "hidden", the application is actually still running, just idling in hide mode. You can do that tho, you can have your application running in the background in an idling state and make the user believe the application is not at all. There's actually several apps that do that.

 

-note- I never make mobile apps, only desktop. But in general, no code is ever reached if the main loop is not updated via your app or another app updating that app. Either way, something has to be updating that loop and running

 

edit: android foreground service: Please login or register to see this link.  keeps your app running while the user is unaware of it

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×