core components of android

7 Core Components Of Android

Introduction:

Core components of android are very essential to understand before getting into android app development. It will help you to build app in a structural way.

After learning these concepts you will surely feel confident while developing apps. Also, it will help you in your android interviews as well. Make sure you read it till the end.

Activities:

Activities are the main and entry point of the android app. It provides the user interface of the app. This is the first thing with which the user interacts with.

The app might have multiple activities like if you are using WhatsApp, so the first screen you see when you open WhatsApp is your recent chats list. This is the first activity, now if you tap on any of the conversations you would navigate to the messaging screen in which you can send the message to the user.

This is another activity. One app might have one activity and more than one activity.

Services:

A service is something that runs in the background of the app. It means it has no UI for the user to interact with. The main purpose of the services is to perform a long-running task or work in the background.

If you have lots of data in your app and you need to sync or upload it to the server and you think it might be the time taking or long-running task so you will need to make a service that will respond to upload the data to the server without any interaction with the user even if your app is closed.

Views:

Everything you see in the app is “VIEWS”. Views create a UI part of the app that makes the app interactable such as buttons, text views, toggle button etc.

Intents:

If you want to navigate from one screen to another screen there is s special class called Intents. Another purpose of intents is to activate services, broadcast receivers etc.

If you want the user to navigate to the web browser from the app or open camera, you need to use Intents.

Content Providers:

Content providers manage data that you can store in any persistent like SQLite, local file system or on the web.

Fragments:

Android fragments are just like activities but they are not actually an individual activity but sub-activity. If you have a single activity you can put as many fragments on it as you want.

The activity can have more than one fragment at the same time.

AndroidManifest

This is the entry point of your android application. Activities, broadcast receivers, services, permissions, etc everything should have to declare inside androidManifest.xml.

Android system starts reading app components through manifest so make sure your components should exist in the manifest file.

Related Posts:

0 Reviews

Leave a Reply