Google made a mistake by saying: "A 
Service<http://developer.android.com/reference/android/app/Service.html> is 
an application component that can perform long-running operations in the 
background", since it makes you assume that it actually does something in 
the background, which it doesn't.

They should have written: ""A 
Service<http://developer.android.com/reference/android/app/Service.html> is 
an application component that helps manage long-running operations".
It's just a way to make your code neat and ordered (especially if IPC is 
needed) with the added benefit of managing some life cycle events for you 
and restarting failed tasks.


On Thursday, August 8, 2013 2:40:02 PM UTC+3, ashish wrote:
>
> I read about services in Android very carefully, but I didn't find any 
> valid reasons to use it. E.g.
>
>    1. 
>    
>    By default services run in the main thread, which most of the 
>    applications don't want.
>    2. 
>    
>    A service can run on a seperate thread if it spawns it own thread. But 
>    if a service runs on a seprate thread, then the method stopService(new 
>    Intent(getApplicationContext(), MyService.class)); does not stop the 
>    running service. Again this is a problem.
>    
> If we want to do some background operations, then I think threads are 
> better than services. Am I right?
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to