12 Nov 2012


Application components of Android

Application components are the main building blocks of Android application in fact they are different entry points through which system enters in your application.Main components are:
  • Activities- represent user interface of an application, every interface has different activity.Activity is implemented as a subclass of Activity.
  • Services- it does not provide user interface.It is the components which run in backgrounds to perform long running operation or to perform remote operation.service is implemented as a subclass of Service
  • Content Providers- it is helpful for storing the data for application.you can perform query operation with stored data. Android has given  SQLite database for storing data on the web.contents providers is implemented as subclass of ContentProvider.
  • Broadcast Receivers - it is a components that respond to a system with a wide broadcast announcements. It does not provide user interface.A broadcast receivers is implemented as a subclass of BroadcastReceivers. each broadcast is delivered as a intent objects.
  • Activating Components- activities,services, broadcast receivers are activated by asynchronous message called as Intent.Intent bind each components at run time.An Intent is created with an intent object.fourth components content providers is activated when targeted by a request from content resolver.
  • Methods for activating components.
  1. Activity is activated by passing an intent to startActivity() or startActivityResult() (for returning result).
  2. Service is activated by passing an intent to startService() or bindService() (for bind to service).
  3. Broadcast is activated by passing an intent to sendBroadcast() or sendOrderedBroadcast() or sendStickyBroadcast( ).
  4. Content Provider is activated by calling query() to content resolver.

No comments:

Post a Comment

Translate