App components are the essential building blocks of
Android applications. Every component is an entry point through which the system or a user can enter your app. Some components rely upon others.
There are four different types of app components:
- Activities: An activity is the entry point for communicating with the user. It represents a single screen with a user interface.
- Services: A service is a general-purpose entry point for having an app running in the background for all kinds of purposes. It is a component that runs in the background to execute long-running transactions or to perform work for remote processes.
- Broadcast receivers: A broadcast receiver is a component that facilitates the system to deliver events to the app outside of a regular user flow, allowing the app to respond to system-wide broadcast announcements.
- Content providers: A content provider manages a shared set of app data that you can store in the file system, on the web, in a SQLite database, or on any other persistent storage location that your app can access.
Each type serves a different purpose and has a different life cycle that determines how the component is created and destroyed.