I need to know, when to use the service in android for simple network task. Before that i tried with the simple example.
Case 1 : Launched a new coroutine in my application and inside the suspend fun simply made a delay for 10000ms.Once i launched i moved my app to the background but still coroutine keeps running in the background.
For how long will the coroutine run when the app is in background ?
Case 2 : Launched the same coroutine like above, But this time i turned on my power saving mode. And moved my app to the background but still coroutine keeps running in the background.
Will coroutine run even in the background, when the doze mode in on ?
Case 3: Launched the same coroutine like above, but this time i moved the app to background and and turned of my screen, but it is still running in the background.
will the coroutine run in the idle state ?
Also i need to know, if any thread or coroutine can run in the background, when do we need a JobIntentService or any other Services need to run the job in the background.
Can anyone clarify this ?