two forms
- Started ( run in the background indefinitely )
- Bounded ( client-server interface that allows components to interact )
- A service runs in the main thread of its hosting process—the service does not create its own thread and does not run in a separate process (unless you specify otherwise).
Creating a Started Service
- Service
- IntentService
- The return value from onStartCommand() escribes how the system should continue the service in the event that the system kills it
- START_NOT_STICKY - do not recreate the service, unless there are pending intents to deliver.
- START_STICKY - started with null when there is no pending request. delivers intent when there is pending request.
- START_REDELIVER_INTENT - recreate the service with the last intent that was delivered to the service
- Local Binder ( if the service is private to the app )
- Messenger
- AIDL
AIDL
- By default, AIDL supports the following data types:
- All primitive types in the Java programming language (such as int, long, char, boolean, and so on)
- String, CharSequence, List, Map
Binder - Internal
( Source )
No comments:
Post a Comment