- Activity
- Service
- Broadcast Receiver
- Content Provider.
An activity represents a single screen with a user
interface.
The user can interact with the activity i.e. click the button.
A service is a component that runs in the background to
perform long-running operations or to perform work for remote processes. A
service does not provide a user interface.
Example:
Listening Music is the service. Because no
user interaction is necessary to play music. Once you start it will playing all
the songs.
A content provider manages a shared set of application
data. You can store the data in the file system, an SQLite database, on the
web, or any other persistent storage location your application can
access.
Example:
Consider that you are going to develop
message sending application. For choosing the contacts you need to add contacts
one by one in your application.
Instead of that you just share the contact
which is in your phone contacts.
A broadcast receiver is a component that responds to
system-wide broadcast announcements.
Example:
It reacts something, when the phone receive any messages or phone etc.
No comments:
Post a Comment