The android application contains four build blocks:
Activity
Intent receiver er
Service
Content Provider
1 activity
In an application, an activity is usually a separate screen. Every activity is implemented as an independent class and inherits from the base class of activity. This activity class will display the user interfaces composed of several views controls and respond to the events.
2 intent and intent Filters
The intent class is used to describe what an application wants to do. In the description structure of intent, there are two most important parts: the data corresponding to the action and action. Typical action types include main, view, pick, and edit. The data corresponding to the action is represented in Uri format.
When you navigate forward, activity calls the startactivity (intent myintent) method. Then, the system finds the activity that best matches the intent of myintent in the intentfilter defined in all installed applications. The new activity starts to run after it receives a notification from myintent. When the startactivity method is called, myintent Parsing is triggered.
3 intent Receiver
When you want your application to respond to an external event, you can use an intent receiver. Intent consumer er is registered in androidmanifest. XML, but you can also use context. registerreceiver () in the Code for registration. When an intent consumer er is triggered, your application does not need to call the intent consumer ER for the request. The system starts your application as needed. Various Applications can also broadcast their own intent Referer to other applications by using context. broadcastintent.
4 Service
A service has a long life cycle and has no user interface. Activity uses context. startservice () to start a service by using context. bindservice () method, connected to a service. After connecting to a service, we can also communicate with the interface provided by the Service.
5 content provider
Applications can save their data to files, SQL databases, or even any valid device. A content provider class implements a set of standard methods, so that other applications can save or read various data types processed by this content provider.