Humans are social in nature. They always prefer to live in a society rather than living alone and thus, they have to interact with each other as well as with the environment in their day to day life. All the activities that a human performs in his life, whether they are mental, physical, emotional or social, are classified as human behavior. Behavior is an important aspect of human’s life. It is the way he acts and interacts. Behavior is influenced by various factors. One important factor is the mood which can be defined as how a person feels. It is not a constant; rather it changes with time and depends on the environment. Examples of mood are happy, sad, excited, angry, shocked etc.
With the recent advancement in technology …show more content…
This method is called when the activity is first created. The second method is the onStart(), which is called when the activity becomes visible to the user. After that, onResume() is called and now the user can start interacting with the activity. onPause() is called when the activity goes to the background and the user cannot interact with it. However, it can be restored later. onStop() is called when the activity becomes invisible and cannot be restored later. onDestroy() is called when the activity is killed and its resources are released.
2.3.2 Service
Service is also an important component of an Android application. It is mainly used for performing long lasting operations. A service always runs in the background and does not need to interact with the user. Therefore, there is no UI for a service. For example, while doing some other work, we may also want to play music in the background at the same time. So in this case, we write the code for playing music in a service class and is run in the background because the user has no need to interact with the music.
Service can be started in two ways. The first way is to call the method startService(), which enables us to run a separate task, and when the task is finished, the service stops automatically. The other method is to bind the service to an application. In this case, the application decides when to start it and when to kill