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

Most Important Topics. International , Science , UPSC, BPSC..

  International Relations Prev First in-Person Meeting of Quad Countries           Star marking (1-5) indicates the importance of topic for CSE Tags:  GS Paper - 2 Groupings & Agreements Involving India and/or Affecting India's Interests Why in News Recently, the first in-person meeting of  Quad  leaders was hosted by the US. Issues like climate change, Covid-19 pandemic and challenges in the Indo Pacific, amidst China's growing military presence in the strategic region, were discussed in the meeting. Key Points Background: In  November 2017, India, Japan, the US and Australia gave shape to the long-pending proposal of setting up the Quad  to develop a new strategy to keep the critical sea routes in the Indo-Pacific free of any influence. China claims nearly all of the disputed  South China Sea , though Taiwan, the Philippines, Brunei, Malaysia and Vietnam all claim parts of it. The South China Sea is an arm of the Western ...

UPSC MCQ

Consider the following statements: 1. Polavaram Project is a multi-purpose irrigation project. 2. It is a dam located across Krishna River. 3. The dam is located in Telangana state. Which of the above written statements is/are true? Choose the correct code from the options given below: A. 1 only B. 3 only C. 1 and 2 D. 2 and 3 Explanation : Polavaram Project is a dam located across Godavari River, located in Andhra Pradesh. It was accorded national project status as part of the legislation bifurcating Andhra Pradesh in 2014. Recently, the Ministry of Water Resources (MoWR), National Water Development Agency (NWDA) and National Bank for Agriculture and Rural Development (NABARD) signed a fresh Memorandum of Agreement (MOA) to provide for a total Rs 1,400 crore as part of the central share. Which of the following statements regarding military exercises is/are correct? 1. Coordinated Patrol (CORPAT) is bilateral naval exercise held between India and Indonesia. 2. Rim of ...

code project , How to learn app development,website ,etc

Welcome to the CodeProject Daily Build Read online version     Wednesday, July 15, 2020 UnoConf 2020 – Virtual & Free Uno Platform’s one day, single-track free online conference on WinUI and Uno Platform powered cross-platform application development for Desktop, Web and Mobile with C# and XAML. Speakers from Microsoft and Uno Platform’s open-source team.  Register now. Headline article Introduction to ELENA Programming Language   (57 votes) by Alex Rakov, Alexandre Bencz (updated  19 hours ago) ELENA is a general-purpose, object-oriented, polymorphic language with late binding New Articles, Tech Blogs and Tips Applications & Tools Tip about importing old fashioned JavaScript libraries into ES6 / ES11 project with webpack   (0 votes) by Sem Shekhovtsov (updated  yesterday) Importing jQuery UI library into ES6 project Artificial Intelligence and Machine Learning Face Touch Detection with TensorFlow.js Part...

So Far Away from the Martin Garrix. Song of the Day.

🔰SONG OF THE DAY🔰 🔰🎼 So Far Away from The Martin Garrix Collection: Deluxe Edition 🎤 by Martin Garrix feat. David Guetta, Jamie Scott & Romy Dya🔰 Light 'em up, light 'em up Tell me where you are, tell me where you are Summer nights, bright lights And the shooting stars, they break my heart Calling you now, but you're not picking up Shadow's so close if you are still in love Then light a match, light a match Baby, in the dark, show me where you are Oh, love How I miss you every single day when I see you on those streets Oh, love Tell me there's a river I can swim that will bring you back to me 'Cause I don't know how to love someone else I don't know how to forget your face No, love God, I miss you every single day, and now you're so far away So far away It's breaking me, I'm losing you We were far from perfect, but we were worth it Too many fight...

Indian Air Force Wing Commander Abhinandan Varthaman

Indian Air Force Wing Commander Abhinandan Varthaman has been chosen for the first Bhagwan Mahavir Ahimsa Puraskar constituted by the Akhil Bharatiya Digambar Jain Mahasamiti. The award which carries a cash prize of Rs. 2.51 lakh, a memento and a citation will be presented to  Abhinandan Varthaman on April 17 the Mahavir Jayanti.

Follow the Page for Daily Updates!