Application Component is the basic building block of every android aplication. Android Application components are very essential for building an Applications.

There are four different types of application components. These are the core component of an Android Application. Each component is an entry point through which the system or a user can enter your app. Some components depend on others.

They are loosely coupled by the application manifest file AndroidManifest.xml that describes each component of the application and how they interact. Each component type has a distinct purpose and distinct lifecycle that describes how the component was created and destroyed.

Android Application Components

Apps are build using Application Components. There are four main components of an Android application. These are

  1. Activities
  2. Services
  3. Content Providers
  4. Broadcast Receivers

1. Activity –

An activity is the first step towards building an Android application. An Activity provides a screen with which users can interact in order to do something. Each activity is given a window in which to draw its user interface.

All activities are independent of one another. However, one activity can start another activity when required. When an activity is stopped because a new activity starts, it is notified of this change in state through the activity’s lifecycle callback methods. We will discuss the activity life cycle in detail in our Activity Lifecycle in Android article.

Activity life cycle :-

Android Application Component

An activity is implemented as a subclass of Activity class as follows −

public class MainActivity extends Activity {


2. Services –

The magic of Service is that it does not need an interface, and all operations are performed in the background. The background function of service is one of the four major components, and its importance is self-evident.

A service is a component that runs in background to perform long running operations and it acts as an invisible worker of our application. It does not provide any user interface. For example, a service might play music in the background while the user is in a different app, or it might fetch data over the network without blocking user interaction with an activity.

A service can make applications continue to execute in the background even when they are closed. The service can be started by other application components, and even if the user switches to another application, the service will continue to run in the background.

Service Life cycle :-

android service

A service is implemented as a subclass of Service class as follows −

public class MyService extends Services { 

Each service class must have a corresponding declaration in its packages AndroidManifest.xml .

3. Content Providers –

A content provider component provides the data from one application to another application on request. These requests are handled by the methods of the ContentResolver class. The data may be stored in the file system, the database or somewhere else entirely.

Content Provider

Content provider manages a shared set of app data that we can store in the file system, in a SQLite database, on the web, or on any other persistent storage location that other apps can access. That means it acts as a bridge between the data and the application.

Content providers manage access to structured data sets. They encapsulate data and provide mechanisms for defining data security. A content provider is a standard interface that connects data in one process to code running in another process.

A content provider is implemented as a subclass of ContentProvider class as follow –

public class MyProvider extends  ContentProvider {
   public void onCreate(){}

4. Broadcast Receivers –

Broadcast receivers are components that listen to broadcast messages(or events) from other application or from system itself and take some actions accordingly. For example sending a low battery message or screen turned off the message to the app.

Broadcast receivers

A broadcast receiver will always get notified of a broadcast, regardless of the status of your application. It doesn’t matter if your application is currently running, in the background or not running at all. Broadcast receivers is use to notify all the registered applications who is register for a particular event. Broadcast Receivers does not have any user interface, they use Intents to deliver broadcast messages(events) to other apps and Broadcast Receivers use status bar notifications to let the user know that broadcast event occurs.

A broadcast receiver is implemented as subclass of BroadcastReceiver as follow –

public class MyReceiver  extends  BroadcastReceiver {
   public void onReceive(context,intent){}

Additional Android Application Components-

There are additional components that are also used in the construction of above-mentioned entities, their logic, and wiring between them. These are:

  1. Fragments
  2. Resources
  3. Layouts
  5. Intents
  6. Manifest File

1. Fragment

Fragment is just a kind of sub-activity which is used to build a multi-pane UI and reuse a fragment in multiple activities. Fragments has their own life-cycle, receives its own input events, and which you can add or remove while the activity is running (sort of like a “sub activity” that you can reuse in different activities). Fragments can be static or dynamic.

2. Resources

Resources in Android is for defining Images, texts, string values. Everything is defined in the resource file and it can be referenced within the source code.

3. Layouts

Android Layouts is used to define the user interface which holds the UI controls or widgets that will appear on the screen of an android application or activity.


View is the basic building block for user interface component. Views are drawn on screen, it includes Button, widget etc. A View occupies a rectangular area on the screen and is responsible for drawing and event handling.

5. Intents

An Intent is a messaging object which is use to request functionality/action from other Android components. Intents are generally used to maintain the communication between different android components. An Intent in the Android application is a software mechanism that allows users to coordinate the functions of different activities to achieve a task.

6. Manifest File

Every android application must have an AndroidManifest.xml file at the root directory of the project source set. The manifest file describes essential information about app. The AndroidManifest.xml file contains the information of application package, including components of the application such as activities, services, broadcast receivers and content providers etc. It also contains all the permissions needed to run the application. For example

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
    android:versionName="1.0" >

Thanks a lot for reading…
Don’t forget to share this post if you found it interesting!
If you find something to add to this post? or any other quick thoughts/hints that you think people will find useful? Share it in the comments & feedback’s are most welcome.

%d bloggers like this: