How to get count of running process inside android service from RunningServiceInfo? Is there anyway to get so? Looks like I have create a confusion, Suppose I have a background service which have two thread inside and it is running. Now I can get service information from RunningServiceInfo, How counld I get the count of thread inside this service from RunningServiceInfo?
Asked
Active
Viewed 265 times
0
-
1http://www.java2s.com/Code/Android/Network/GetRunningServicesInfo.htm tried ? – J.K Dec 20 '14 at 09:36
-
`RunningServiceInfo.clientCount`? Is it what you are looking for? – pskink Dec 20 '14 at 09:36
-
@pskink No. I have updated the question. Please have a look. – StartCoding Dec 20 '14 at 09:51
-
you can get number of clients, not number of threads – pskink Dec 20 '14 at 09:53
-
@pskink Yeah, but I need count of thread inside this service – StartCoding Dec 20 '14 at 09:54
-
There's no such data in `RunningServiceInfo`, what do you need it for? – pskink Dec 20 '14 at 10:03
-
@pskink Any other way to do so?? please suggest, there must be some way to do so. We can see this feature inside taskmanager app>Running Service> list of service(1 process 1 service) – StartCoding Dec 20 '14 at 10:09
-
so you have #processes and #services, not **#threads** – pskink Dec 20 '14 at 10:12
-
@pskink yes, this thread is shown as #process – StartCoding Dec 20 '14 at 10:14
-
no: process != thread, read http://en.wikipedia.org/wiki/Thread_%28computing%29#Threads_vs._processes or http://stackoverflow.com/questions/200469/what-is-the-difference-between-a-process-and-a-thread or http://www.programmerinterview.com/index.php/operating-systems/thread-vs-process/ – pskink Dec 20 '14 at 10:15
-
@pskink yeah, I know. I just want to set analogy. – StartCoding Dec 20 '14 at 10:17
-
Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/67373/discussion-between-startcoding-and-pskink). – StartCoding Dec 20 '14 at 11:07