- Home /
Run script or app in background on android?
I have a very simple script that take data from a json web api and saves it to device storage every 60 seconds. Problem I run into is that if the app is not presently open on the screen then it pauses. Apparently unity doesn't have a built in feature for run in background on Android. Does anyone know of a method to keep an app open in the background? I only need that single C# script to run in the background but if the entire instance keeps going that's OK too. Note: this app will never be published or public in any way so if it needs to be system specific that's ok. I use galaxy S20 FE.
Answer by Eno-Khaon · Sep 03, 2021 at 07:06 PM
I can't guarantee that this is exactly what you're looking for, but this may be a good place to start.
As a general rule, you can only rely on a Service to run in the background on Android, so that should also be a usable term to search around for.
If you find something that works, let us know! The more information we have here, the better.
Thank you for this answer. When looking further into it I found this from the unity store. I'm not sure that it's the same thing but it works very well for running stuff in the background and is the solution I found. https://assetstore.unity.com/packages/tools/integration/task-invoker-mobile-background-tasks-165472
Your answer
Follow this Question
Related Questions
How to make looped background?(Character enters left side and appears from right) 2 Answers
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Downloading file in android background 0 Answers
Could a mobile app have a service application compiled targetting a higher version of .net? 0 Answers