4 Major Android Application Components

4 Major Android Application Components


This part of the Android training in Chandigarh describes the various Android application components used in Android development. There are four basic components and some additional application components. Learn them in detail.
The Android app has been developed using JAVA, Kotlin and C +. Application components are very important for building an application. These act as entrances for the user or system to enter the application. There are 4 different types of components. Each component has its own purpose and a clear life cycle.

Major Android Application Components


The basic components of an Android application are: Activities An activity is a class that is considered as an entry point for users who represents a single screen. There may be an activity in a messenger application that shows a new notification, another activity that reads the messages and the other that creates a new message. Each activity is independent of one another. Example – camera application can be begun in an email application to compose an email that shares an image. The picture below depicts how each new activity adds an item to back stack and how the current activity is destroyed and previous activity is continued. Services A service is a component that keeps running in the background, it acts as an invisible worker of our application. It continues updating data sources and activities. It also broadcasts intents and performs tasks when applications are not active. An example of service is we can surf the internet or utilize some other application while tuning in to music. Content Providers Content Provider is a component that enables applications to share data among different applications. It hides the details of the database and can be utilized to peruse and compose private information of the application which isn't shared. It would be a mess to access data from different applications without content providers. Broadcast Receiver Broadcast Receiver is a component that reacts to broadcast messages from another application or a similar system. It can also deliver broadcasts to applications that are not running. Example – notify the user that the battery is low. Android developers can use broadcast messages in the app or outside of the normal flow. Read also - Android Architecture: Key Components

Additional Components of Android Application


Some additional components of an android application:


Intents
This is an inter-application message passing framework for communication between Android components.
It is also utilized for moving data between different Activities just as to begin another new service and display a list of contacts in ListView. Example – the camera application sends an intent to the operating system when the user chooses to share a picture.
Widgets.
Widgets are varieties of Broadcast Receivers and fundamental parts of home screen customization. They display data and allow users to perform actions on them. There are different kinds of widgets:
  • Information widget: These widgets show crucial information and track how the information changes over time. Example – Clock widgets and widgets that display weather and time information.
  • Collection widget: As the name depicts, collection widgets are a collection of information of the same type. Its use is for browsing information and opening any one of the elements to view details. Example – music widgets, as we can skip pause and play music outside the music application.
  • Control widget: These widgets show functionalities and by utilizing them, the user can trigger from home screen without opening the application.
  • Hybrid Widgets: These widgets combine all the features of the other three widgets. Example – music player widget is a control widget but it additionally informs the user about which track is playing currently, which means it is a combination of control And the information is therefore called a hybrid widget.
  • Views
    View is responsible for drawing and event handling. They are rectangular components on the screen. A portion of the views are EditText, ImageView Button, CheckBox and ImageButton.
    Notifications
    It alerts users when the application is not visible or is inactive. This alert flashes on the screen and then disappears. Example – Notification of the new incoming message flew on the screen.
    Fragments
    A fragment is a portion of the total user interface. Users can combine more than one fragment in a single activity and these parts can be reused in different activities. A fragment generally contains Views and ViewGroups inside them.
    Layout XML Files
    Layout is the structure for the UI in the application. XML files give various sorts of layouts for the diverse kinds of screen, it also specifies which GUI component, an activity or fragment holds.
    App APK files
    Apk file is the package file format that contains the program's code, assets, resources. The Android operating system utilizes them for installing mobile applications and middleware.
    Resources
    Resources in Android is for characterizing Images, texts, string values. Everything is characterized in the resource file and it can be referenced within the source code.

    Summary


    In this Android training in Chandigarh article, we considered fundamental Android's Application components and some additional components used for android application development. Also, we tried to clarify each application component clearly still.

    좋은 웹페이지 즐겨찾기