AndroidLearner AndroidLearner - 3 years ago 162
Android Question

Application Process Lifecyle

I want to know what happens to the process in the below specific use case.

Use case: I have an application with a schedule job either with

AlarmManager
or
JobScheduler api
now when user exits my application with force stops from settings menu and also my application doesn't have any services running in background except when running a scheduled job where in i use a background service.

So i want to know what happens now in the below mentioned scenarios.


  • if process is killed, what happens at the time of running scheduled jobs, will a new process be created by android.

  • what happens to the process if device goes to deep sleep mode.


Answer Source

if process is killed, what happens at the time of running scheduled jobs, will a new process be created by android.

From Android 3.1+ nothing will happen i.e process is terminated after force stop is pressed from settings menu. So reschedule alarm when user opens the application again.

what happens to the process if device goes to deep sleep mode.

The process execution halts in sleep mode unless some event that is capable of waking the device from sleep mode is happened like phone call, text message, socket connection, Alarm Manager event, etc.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download