Please enable JavaScript.
Coggle requires JavaScript to display documents.
android application component, Serivice - Coggle Diagram
-
Serivice
servervice help we can handle and run application on background we can know service is a activity no layout, service call Main thread and run on main thread, instead if we want you service on background thread we you intent service
bound service
-
when all client call unbind service or all client containt this serivce already killed this service also destroy
unbound service
-
-
bound service that mean it not dependencies with activity and it can run when application was kiiled
when service wasn't stated and you call StartService it will call oncreate -> onstartComant, and when call service startService but service stated it will call method onstartCommant
-
-
START_REDELEVER_INTENT: notify for system when service killed, system will restart service with intent is a final intent service reserved, ex: when you down load a file and you want service continute download
-
when call startService on startCommant have a param startid and this Id will add more a unit when u call start service
stopSeft(startId) can help you stop the service but it on stop when final startid equa with startId in stopSeflt
How to create a service: first create a class extent a service -> define serice on mainifrest-> call oncrreate, onstartcommant and on Destroy, it's lifecycle of the service
-