Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is an Android Service a process or thread?

Is an Android "Service" considered a process or a thread according to operating system?

like image 955
Vinay Avatar asked Dec 07 '22 01:12

Vinay


2 Answers

It is neither, any more than an activity is "a process or a thread".

All components of an Android application run inside a process and by default utilize one main application thread. You can create your own threads as needed.

like image 147
CommonsWare Avatar answered Dec 12 '22 05:12

CommonsWare


A Service can be implemented as a separate process depending on the requirement. Here is a good explanation when to implement the service as a separate process or as a component inside an existing app (Service with Activities in same process).

like image 26
Vinay Avatar answered Dec 12 '22 06:12

Vinay