Components in Android

What are the main components of Android Application?

The following components are the building blocks of Android applications:

1. Activities: An activity is a screen that contains the user interface. User can interact with these activities to perform some task such as send an email, send messages or taking the photo. The number of activities in an application can be one or more than one. It depends upon the application type. An activity can start another activity within the application or another application to perform different actions. The main purpose of an activity is to interact with the user.
2. Services: Service components run without a UI. Services run in the background without interacting with the user. Services help to execute tasks automatically. They are also used to perform long running tasks.
3. Content Providers: A content provider, provides the content to external applications. It helps to share data across application boundaries.
4. Intents: Are used to navigate from one activity to another activity. You can use Intents to start and stop Activities and Services. There are two types of Intents.
  • Explicit Intents
  • Implicit Intents
5. Broadcast Receivers: Are used to listen for Intents according to your criteria.
6. Notifications: These are used to provide small messages to user. They alert users by flashing lights, playing sounds or displaying icons.