Android Building Blocks.

Binayak Adhikari
Jul 20, 2017 · 2 min read

The fundamental building blocks of Android are Activities, Services, Broadcast Receivers and Content Providers. Interchange in data between these blocks is handled by Intents which can be either Explicit or Implicit intents.

There are following four main components that can be used within an Android application.

Activities

It Control the UI and handle the user interaction to the Android App screen,it represents a single screen with a user interface.Activity performs actions on the screen, For example, Medium application might have one activity that shows a list of articles while another activity to read the Notifications and another activity for viewing user profile.

Services

The Service is another building block of Android applications. They handle background running tasks associated with an application. It is a program that can run in the background for an infinite period and it does not provide a UI. A good example of service is the music player app, let us consider Google play Music which keep on playing music while the main android app activity is destroyed or closed.

Broadcast Receivers

They handle communication between core Android OS and applications running on the surface layer. The application modules communicate with each other using the broadcast receiver. Messages can be initiated by the system or the app. For example, if a user is using your app and a phone call comes in, the Broadcast Receiver interface will notify your app.

Content Providers

They handle data interchange and database related components. This provides a uniform singular interface to the content & data. The content can be from your app being exposed to the system or other apps or it could be system content for example, pictures on your phone, contact lists, or files in the file system. It provides a consistent interface to retrieve/store data via external data sources or databases.

References:

https://developer.android.com/

Find code on:

https://github.com/BinayakAdhikari

)
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade