Application components are the essential building blocks of Android applications. Each component is an entry point where the system or user can enter your application. Some components depend on other components.
There are four types of application components:
Activity
Service
Broadcast receiver
Material provider
Each type has its own use and life cycle that defines how components are created and destroyed. The following sections describe the four types of application components.
Aktivitas
Activities are entry points for interacting with users. It represents a single screen with a user interface. For example, an email app might have one activity that displays a list of new emails, another activity for composing emails, and another activity for reading emails. For example, the camera app could start an activity in the email app that creates a new email for users to share images with. Activities simplify the following important interactions between the system and applications:
Keep track of what’s important to the current user (what’s on the screen) to ensure that the system keeps the process hosting the activity running.
Understand the processes used previously contain something that the user can return (stopped activity), so prioritize maintaining the process.
Help deal with apps stopping their processes so that users can return to activities with their previous state restored.
Provides a way for applications to implement flows between users, and for the system to coordinate these flows. (The most classic examples are being shared here).
.
Services
Services are versatile entry points to keep apps running in the background for all kinds of reasons. These are components that run in the background to perform long-running operations or to do work for remote processes. The service does not provide a user interface. Other components, such as activities, can start the service and let it run or bind the service to interact with it. There are actually two different semantic services that tell the system how to manage the application: The started service tells the system to keep it running until its job is done. This could be for syncing some data in the background or playing music even after the user leaves the app. Syncing data in the background or playing music also represent two different types of startup services, which modify how the system handles them:
Music playing is something that the user is directly aware of, so the app notifies the system by saying it wants to run in the foreground with a notification to notify the user of this; in this case the system understands that it must really try hard to keep the service process running, because the user will be unhappy if the service is lost.
A regular background service is not something the user is directly aware of as a running service, so the system has more freedom in managing the process. This service may be allowed to shut down (and then restart later) if it requires RAM for more important things to the user.
The need for digital IT is needed in daily activities, Bead IT Consultant is the right choice as your partner, visit our website by clicking this link: www.beadgroup.com