App components are the essential building blocks of an Android app. Each component is a different point through which the system can enter your app.

Not all components are actual entry points for the user and some depend on each other, but each one exists as its own entity and plays a specific role each one is a unique building block that helps define your app's overall behavior.

Android Apps Core Components

There are four different types of app components. Each type serves a distinct purpose and has a distinct lifecycle that defines how the component is created and destroyed.

An Android application consists four types of app core components.

Like musicians in an orchestra, the independent core components cooperate with each other contributing somehow to the success of the application.

A core component can be:
1. An Activity
2. A Service
3. A broadcast receiver
4. A content provider

Here is details of four core component of android...

1. Activity
  • A typical Android application consists of one or more activities.
  • An activity is roughly equivalent to a Windows-Form .
  • An activity usually shows a single visual user interface (UI).
  • Only one activity is chosen to be executed first when the application is launched.
  • An activity may transfer control and data to another activity through an interprocess communication protocol called intents.

2. Service
  • Services are a special type of activity that do not have a visual user interface.
  • Services usually run in the background for an indefinite period of time.
  • Applications start their own services or connect to services already active.
  • For example, your background GPS service could be set to inconspicuosly run in the backgroud detecting satellite, phone tower or wi-fi router location information. The service periodically broadcast location coordinates to any application listening for that kind of data. An application may bind to the running GPS service or be the first to execute it.

3. Broadcast receiver
  • A BroadcastReceiver is a dedicated listener that waits for system-wide or locally transmitted messages.
  • Broadcast receivers do not display a user interface.
  • They tipically register with the system by means of a filter acting as a key.
  • When the broadcasted message matches the key the receiver is activated.
  • A broadcast receiver could respond by either executing a specific activity or use the notification mechanism to request the user‘s attention.

4. Content provider
  • A content provider is a data-centric service that makes persistent datasets available to any number of applications.
  • Common global datasets include: contacts, pictures, messages, audio files, emails.
  • The global datasets are usually stored in a SQLite database.
  • The content provider class offers a standard set of “database-like“ methods to enable other applications to retrieve, delete, update, and insert data items.
Read More:
  1. What is Android? Introduction, Features and Applications.
  2. Android Resources for Beginner to Learn Apps Development
  3. Unlock Android After Too Many Pattern Attempts
  4. How to Speed-up Android Phone
  5. Android Secret Codes for All Mobile

Post a Comment

 
Top