Interview answers verified by specialists.
Find interview questions and answers on this website:
The services allow the proper functioning of the system. - The service starts with Context.startService() function and the system will retrieve the service using onCreate() method. To start the service it calls on onStartCommand(Intent, int, int)method with proper arguments that are given by the client. - If the service is running and due to some problem the user doesn't want to run it then it uses Context.stopService()or stopSelf() method to properly implement the service for the user. - Due to multiple calls of the Context.startService() method the program doesn't do any nesting of the program and shows the stopping of the services. - Services can use the command stopSelf(int)method to stop their own service. A service doesn't stop untill all the processes are processed.