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:
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.
Reference
이 문제에 관하여(4 Major Android Application Components), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/cbitssexp/items/48a340cf5932867adf93텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)