Saturday 11 January 2014

Android Fundamentals


  1. Activity
  2. Service
  3. Broadcast Receiver
  4. Content Provider.
Activity
An activity represents a single screen with a user interface.
The user can interact with the activity i.e. click the button.

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 neccessary to play music. Once you start it will playing all the songs.
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.

broadcast receiver is a component that responds to system-wide broadcast announcements.

            Example:
                      It reacts some thing, when the phone receive any messages or phone etc.

No comments:

Post a Comment