I studied this topic because I wanted to know more. So I found out the following:
Android OS attaches great importance to our application, based on the following factors:
- Foreground Process -
onResume()when we interact with the user interface of the application. (Highest value) - The visible process is
onPause()when some kind of dialog box goes beyond the application that we are currently using. - Service process . There is no interaction with the user interface, but there is a service that works best, for example, an MP3 player.
- Background process . There is no interaction with the user interface, but there is a thread trying to load the image.
- The empty process . In this process no active components (
Activity, Service, Content Provideror BroadCast Receiver). (The lowest value will be the first to be deleted from memory).
I should give a seminar on this topic, but, of course, I need to give an example for each of the above 5 cases.
I find it difficult to find an example of a Background process .
So, for an application that should be classified as a background process for the Android OS, then there should be no user interaction, and the thread should work.
The fact is that I cannot come up with a convincing example for a background process.
Can someone help me?
Edit (Only for people who think this section has nothing to do with memory management)
, Android ( ), , , , .