Android Programming and Technical Programming Variables

Bound service: binding to a service, what is the function that needs to be implemented in service class?
Options
1) onCreate()
2) onBind() & onUnbind()
3) ServiceConnectionListener in client side.
4) all above 3 are required

Read Solution (Total 0)

Android Other Question

start a service from activity and close activity, what will happen to that service, will it be alive or dead?

Options
1) service will also be killed
2) service will be alive for some time, and will be killed by android garbage collector.
3) service will run for ever, no body can stop it now, and it leaks memory.
4) service will be keep running in the background but it can stop itself when the work given to it is done. Or others also can kill that service using stopService(), or android also can kill the service forcefully in case of low memory scenarios.
How to create a service with multiple threads in it?
Options
1) Create a service with creating thread in onStartCommand
2) Use Intent Service
3) Create a service with one thread in OnCreate().
4) Either use option1 or use Async task with service