2. Service?
A Service is an application component that can perform long-
running operations in the background and does not provide a
user interface. Another application component can start a service
and it will continue to run in the background even if the user
switches to another application.
.
handle network transactions
play music
perform file I/O
interact with a content provider
蠍壱 焔
覦郁化 讌.
9. Service 覲 Thread螳 .
A service runs in the main thread of its hosting processthe service
does not create its own thread and does not run in a
separate process (unless you specify otherwise). This means that, if
your service is going to do any CPU intensive work or blocking operations
(such as MP3 playback or networking), you should create a new
thread within the service to do that work. By using a
separate thread, you will reduce the risk of Application Not Responding
(ANR) errors and the application's main thread can remain
dedicated to user interaction with your activities.