A game is basically an application in terms of functionality. Multiple applications or games can run on an Android platform. However, for games, only one game is active at one point of time, but rest of the applications run in the background.
Let's have a look at how Android processes its applications.
Android sets the priority of the running applications, and it can kill a running application of low priority depending on the requirement.
Each application uses some memory and processing bandwidth. There may be a situation where multiple applications are running together. If a new application wants to run, then Android allocates memory and process bandwidth for the new application. If there is not enough bandwidth or process available, then Android kills one or more than one running application with low priority.
Android sets priority by the following status:
An active process is basically a process that communicates with the platform very frequently and runs in the foreground. This process is the last one to be killed by Android, when necessary.
An active process fulfils the following criteria:
This process is basically an active process that is not in the foreground and does not interact with the user interface. It is the second highest priority for the Android platform.
The criteria for this process are as follows:
Active services are services that support an ongoing process without a visible interface. Android will kill such services first and then the actual active process.
This service follows the following criteria:
Background processes are basically minimized or inactive processes. These processes are not visible on the screen. The process thread does not run for these processes, but the application state is saved in the memory. These are vulnerable to being killed by the processor. These processes can be resumed after interruption.
These are inactive/minimized processes. They remain in memory. The application stays in the paused state.
Android application services are parts of the actual application process. These services may run within and outside the parent process.
Let's clear two very common misconceptions about services:
The fact is, services are part of an application process and not separate processes. Services are not threads. They are part of the process that runs in the background, and they keep running even if the main application is in a suspended state.
Services are meant to carry out a single task and do not call back the parent application. This is why they can run even after the application is closed.
Services are started by the parent application process, as follows:
Context.startService();
After being started, the service starts carrying out a single task in the background. The service can stop itself after the task is done. For example, a simple file download service will stop after a successful downloading task. Many game developers use such features in their games to improve the user experience.
These services can be bound with one or more processes for interactivity. The application can send request and get response from a bound service, which creates a server-client architecture. But these bound services have a limited lifetime until the last application component is bound with the service.
Android has its own resource process structure. It has some predefined resource types:
All drawable resources fall in this category, including frame animation. Android provides the res/drawable/
project path dedicated to all drawable resources. All bitmaps, various XML, and predetermined frame animations can be placed here.
These can be accessed through the R.drawable
class.
All defined layouts fall in this category. Android provides the res/layout/
project path dedicated to all layout files. Layout is useful to define the application UI.
These can be accessed through the R.layout
class.
Color resources are basically a list of colors that are due to change upon changing the view of the applicable object. Android stores this in the res/color/
folder in the hierarchy.
These can be accessed through the R.color
class.
All menu contents can be defined here. Android provides the res/menu/
project path dedicated to all drawable resources.
These can be accessed through the R.menu
class.
3.14.141.115