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 ...

Oil report

The United Nations (UN) on 18 December 2014 sent a team of international experts to help Bangladesh in cleaning up the Sundarbans oil spill. The team belonging to the United Nations Disaster Assessment and Coordination (UNDAC) was sent on a request from Bangladesh government. The UN team will help Bangladesh government in the ground work and will also conduct an assessment and advise on recovery and risk reduction measures. The team comprises of experts from Britain, European Union, France and the United States. Besides, the UN asked Dhaka to impose a complete ban on the movement of commercial vessels through the Sundarbans.

World most famous article

1. Walmart to open new store in India after 2-year gap  i. After a gap of two years, US retail major Walmart will open a new cash and carry store in Agra as it returns focus on India.  ii. The company, which opened its last store in Bhopal towards the end of 2012, has said it will focus on cash and carry business in India in the absence of clarity on FDI in multi-brand retail trade. iii. "Walmart is committed to India and we are focused on our growth plans... We have recently received all internal approvals for opening a new store in Agra, our second one in the city," Walmart spokesperson told PTI. 2. Jyotsna Suri elected as the President of the FICCI i. Jyotsna Suri, Chairperson of Bharat Hotels, on 20 December 2014 was elected as the President of the Federation of Indian Chambers of Commerce & Industry (FICCI). ii. Suri succeeded Sidharth Birla. iii. Alok B Shriram, deputy managing director of DCM Shriram Industries Ltd, assumed the charge of the presid...
1. Suicide bomb, gunfight at Afghan bank, civilians inside. i. Taliban militants detonated a suicide bomb and stormed a bank in southern Afghanistan . ii. The attackers forced their way inside after the bomb exploded at the entrance of the Kabul Bank branch in Lashkar Gah killing at least six people, the capital of the insurgency-racked province of Helmand. iii. A Taliban spokesman claimed responsibility for the attack on Kabul Bank, an institution that nearly collapsed in 2010 in a $900 million fraud case that underlined endemic corruption in Afghanistan.  2. Lok Sabha passed NCT of Delhi Laws (Special Provisions) Amendment Bill, 2014. i. The Lok Sabha passed the National Capital Territory (NCT) of Delhi Laws (Special Provisions) Amendment Bill, 2014. The bill was presented in Lok Sabha by the Union Urban Development Minister Venkaiah Naidu. ii. The Bill seeks to amend the National Capital Territory of Delhi Laws (Special Provisions) Second Act, 2011 as the deadlines...

GDP projection by IMF:

 GDP projection by IMF:   ðŸ‡¨ðŸ‡³ China GDP: 2023: $19.374 trillion 2028: $27.4 trillion 2075: $57 trillion 🇮🇳 India GDP: 2023: $3.737 trillion 2028: $5.5 trillion 2075: $52.5 trillion 🇺🇲 US GDP: 2023: $26.855 trillion 2028: $32.3 trillion 2075: $51.5 trillion

Follow the Page for Daily Updates!