This last point is crucial for the purpose of having long running TCP connections, or other background tasks, such as the one required e.g. When all the intents have been processed, the IntentService stops itself by calling StopSelf internally. This queue processes each intent serially on a separate thread, passing the intent to the OnHandleIntent method. The IntentService works by sending all intents to a worker queue for processing. As an additional option Android provides the IntentService class. Thus, Service class can be complicated to use. By default, Service object's operations run on the main thread, so a background thread must be constructed for such operations. BackgroundĪndroid services are provided by the Service class. The class features an IntentService like interface to use, but with the missing IntentService "sticky" behavior. StickyIntentService is suitable for including a reference to a long running background listening TCP connection, such as the one required by XMPP libraries, e.g.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |