Skip to main content

Android Application component .

Application components are the essential building blocks of an Android application. These components are loosely coupled by the application manifest file AndroidManifest.xml that describes each component of the application and how they interact.
There are following four main components that can be used within an Android application:
ComponentsDescription
ActivitiesThey dictate the UI and handle the user interaction to the smartphone screen
ServicesThey handle background processing associated with an application.
Broadcast ReceiversThey handle communication between Android OS and applications.
Content ProvidersThey handle data and database management issues.

Activities

An activity represents a single screen with a user interface. For example, an email application might have one activity that shows a list of new emails, another activity to compose an email, and another activity for reading emails. If an application has more than one activity, then one of them should be marked as the activity that is presented when the application is launched.
An activity is implemented as a subclass of Activity class as follows:
public class MainActivity extends Activity {

}

Services

A service is a component that runs in the background to perform long-running operations. For example, a service might play music in the background while the user is in a different application, or it might fetch data over the network without blocking user interaction with an activity.
A service is implemented as a subclass of Service class as follows:
public class MyService extends Service {

}

Broadcast Receivers

Broadcast Receivers simply respond to broadcast messages from other applications or from the system. For example, applications can also initiate broadcasts to let other applications know that some data has been downloaded to the device and is available for them to use, so this is broadcast receiver who will intercept this communication and will initiate appropriate action.
A broadcast receiver is implemented as a subclass of BroadcastReceiver class and each message is broadcasted as an Intent object.
public class MyReceiver  extends  BroadcastReceiver {

}

Content Providers

A content provider component supplies data from one application to others on request. Such requests are handled by the methods of the ContentResolver class. The data may be stored in the file system, the database or somewhere else entirely.
A content provider is implemented as a subclass of ContentProvider class and must implement a standard set of APIs that enable other applications to perform transactions.
public class MyContentProvider extends  ContentProvider {

}
We will go through these tags in detail while covering application components in individual chapters.

Additional Components

There are additional components which will be used in the construction of above mentioned entities, their logic, and wiring between them. These components are:
ComponentsDescription
FragmentsRepresents a behavior or a portion of user interface in an Activity.
ViewsUI elements that are drawn onscreen including buttons, lists forms etc.
LayoutsView hierarchies that control screen format and appearance of the views.
IntentsMessages wiring components together.
ResourcesExternal elements, such as strings, constants and drawables pictures.
ManifestConfiguration file for the application.

Comments

Popular Post

What is prompt engineering?

  Prompt engineering refers to the process of designing or crafting effective and specific prompts to interact with AI language models. It involves formulating queries, instructions, or input text that can elicit desired responses or outputs from the AI model. The goal of prompt engineering is to guide the model's behavior and generate more accurate and relevant results. Prompt engineering is especially important in the context of AI language models like GPT-3 (Generative Pre-trained Transformer 3) and similar models. These models are incredibly powerful but also very large and complex. Without well-crafted prompts, they may produce responses that are nonsensical, biased, or otherwise undesirable. The process of prompt engineering involves several key steps: Understanding the Model: Familiarize yourself with the capabilities and limitations of the AI language model you are working with. Understand the types of questions or inputs it can handle effectively. Defining the Task: Clea...

How to earn money using ChatGPT !

  Content Creation and Writing: You can use AI language models to assist in content creation, such as writing articles, blog posts, or social media content. Some content creators use AI-generated drafts and then refine them with their own ideas and style. Language Translation Services: You can offer language translation services using AI language models to help with translating documents or text between different languages. Chatbot Development: If you have programming skills, you can integrate AI language models into chatbots for businesses or websites, helping them provide automated customer support. Tutoring and Educational Assistance: Use AI language models to create educational content, answer students' questions, or provide tutoring support in specific subjects. Copywriting and Marketing: Assist in generating marketing copy, ad content, or email campaigns using AI language models to improve efficiency and creativity. Writing and Publishing Books: Some authors use AI lang...
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- srportalgiri_main_AdSense1_250x250_as --> <ins class="adsbygoogle"      style="display:inline-block;width:250px;height:250px"      data-ad-client="ca-pub-2060990885270177"      data-ad-slot="4129699440"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>

ESG funds . Details about ESG funds.

ESG funds ✅The asset size of ESG funds has ballooned nearly five times to Rs 12,300 crore over the last couple of years. ✅Environment, social responsibility, and corporate governance have of late emerged as key themes for investors in India. ✅The demand and growth for ESG funds in Asia, especially in India, has been overwhelming, it is 32%. ● What are ESG Funds? ✅They are used synonymously with sustainable and socially responsible investing. ✅While selecting a stock for investment, an ESG fund shortlists companies that score high on environment, social responsibility, and corporate governance, and then looks at financial factors. ✅With the overall increase in awareness, and with regulations moving in this direction, investors are re-evaluating traditional approaches and considering the impact of their decisions on the planet. ✅The key difference between the ESG funds and other funds is 'conscience ' i.e the ESG fund focuses on companies with environment-friendly practices, ethi...

India Citizenship Amendment Act 2019

Protection of minors 1. There have been several instances of police clashing with and detaining protesters in the Anti-CAA protests. 2. In several cases, those detained were minors under 18 years. Detention of minors 1. Juvenile Justice (Care and Protection of Children) Act, 2015 has specific procedures and rules in relation to children found to be in conflict with the law. 2. As soon as a child alleged to be in conflict with law is apprehended by the police, the child is to be placed under the charge of the special juvenile police unit or the designated child welfare police officer. 3. That officer should produce the child before the Juvenile Justice Board within a period of 24 hours excluding the time necessary for the journey from the place where the child was picked up. 4. In no case should a child alleged to be in conflict with the law be placed in a police lock-up or lodged in a jail. NCPCR 1. National Commission for Protection of Child Rights (NCPCR) is a statutory bod...

Follow the Page for Daily Updates!