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

Apple is testing a ChatGPT-like AI chatbot

  According to a recent report by Bloomberg's Mark Gurman, Apple is making significant strides in the development of artificial intelligence tools to rival the likes of OpenAI and Google. Internally referred to as "Apple GPT," the tech giant has created a chatbot using its proprietary framework called "Ajax." This framework, built on Google Cloud with Google JAX, enables the creation of large language models similar to ChatGPT and Google's Bard. While Apple is yet to finalize its strategy for consumer release, it is reportedly planning a major AI-related announcement next year. The chatbot's internal rollout faced delays due to security concerns related to generative AI. However, it has been made available to a growing number of Apple employees with special approval, primarily for product prototyping purposes. Apple's chatbot can summarize text and answer questions based on its training data. Although it shares similarities with commercially availabl...

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

UPSC

📌PERIOD POVERTY Scotland may become the first country in the world to end ‘period poverty’ by making sanitary products free for all. About: • The Scottish Parliament passed the Period Products (Free Provision) (Scotland) Bill. • Referring to “period dignity”, the legislation aims to develop a universal system in Scotland, which will provide free sanitary products for “anyone who needs them”. • As of now, in Scotland, the provision of free sanitary products is already available in schools, universities and colleges. • The Bill has only passed the first hurdle to become a law. It still needs to be considered by a parliamentary committee, following which it will require approval from the parliament. It will finally need the Royal Assent of the Queen.  ▪️Important Info : What is ‘period poverty’? Some circumstances make menstruation a “difficult experience” for women. T...

Mobile hacking code.

               Hack Code. 1] *#0000# Displays Your Phones software version,Ist line: Software version, 2nd line: software release date,3rd line: compression type 2] *#9999# Phones softwares version if *#0000# does not work 3] *#06# For checking the international Mobile Equipment identity(IMEI number) 4] *#2640# Displays security Code in use 5] #pw+1234567890+1# Provides Lock Status(use the * button to obtain the "p,w,+" symbols for following codes)  6] #pw+1234567890+2# Network Lock Status(use the * button to obtain the "p,w,+" symbols for following codes)  7] #pw+1234567890+3# Country lock Status (use the * button to obtain the "p,w,+" symbols for following codes)  8] #pw+1234567890+4# SIM card Lock status(use the * button to obtain the "p,w,+" symbols for following codes) 9] *#21# Allows u to check the number that "All Calls" are diverted to 10] *#30# Lets u see the private number 11] *#43# Allows u to ch...

UPSC ARTICLE

๐Ÿ“š เคจिเคตेเคถเค•ों เค•ो เคจเคˆ เคคेเคฒ เคต เค—ैเคธ เคจीเคคि เคธे เคฒुเคญाเคจे เค•ी เค•ोเคถिเคถ เคธเคฐเค•ाเคฐ เคจे เคคेเคฒ เคเคตं เค—ैเคธ เค–ोเคœ เค•्เคทेเคค्เคฐ เคฎें เคจिเคœी เค”เคฐ เคตिเคฆेเคถी เคจिเคตेเคถ เค†เค•เคฐ्เคทिเคค เค•เคฐเคจे เค•े เคฒिเค เค‡เคธเคธे เคœुเคก़ी เคจीเคคि เคฎें เค…เคนเคฎ เคฌเคฆเคฒाเคต เค•िเค เคนैं। เคจเคˆ เคจीเคคि เค•े เคคเคนเคค เคธเคฐเค•ाเคฐ เคจเค เคเคตं เค•เคฎ เค–ोเคœे เค—เค เค•्เคทेเคค्เคฐों เคฎें เคนाเค‡เคก्เคฐोเค•ाเคฐ्เคฌเคจ เค‰เคค्เคชाเคฆเคจ เคชเคฐ เคธंเคฌंเคงिเคค เค•ंเคชเคจी เคธे เคฒाเคญ เคฎें เคนिเคธ्เคธा เคจเคนीं เคฎांเค—ेเค—ी। เคนเคฐ เคคเคฐเคน เค•े เคฌेเคธिเคจ เค•े เคฒिเค เคเค• เคธเคฎाเคจ เค…เคจुเคฌंเคง เคตाเคฒी เคฆो เคฆเคถเค• เคชुเคฐाเคจी เคจीเคคि เคฎें เคฌเคฆเคฒाเคต เค•เคฐเคคे เคนुเค เคจเคˆ เคจीเคคि เคฎें เค…เคฒเค—-เค…เคฒเค— เค•्เคทेเคค्เคฐों เค•े เคฒिเค เค…เคฒเค—-เค…เคฒเค— เคจिเคฏเคฎ เคฌเคจाเค เค—เค เคนैं। เค‡เคธเค•े เคคเคนเคค เคชเคนเคฒे เคธे เค‰เคค्เคชाเคฆเคจ เคตाเคฒे เค•्เคทेเคค्เคฐों เค”เคฐ เคจเค เค•्เคทेเคค्เคฐों เค•े เคฒिเค เคจिเคฏเคฎ เค…เคฒเค—-เค…เคฒเค— เคฐเคนेंเค—े। เค†เคงिเค•ाเคฐिเค• เค…เคงिเคธूเคšเคจा เค•े เค…เคจुเคธाเคฐ เค‰เคค्เคชाเคฆเค•ों เค•ो เคญเคตिเคท्เคฏ เคฎें เคฌोเคฒी เค•े เคฆौเคฐाเคจ เคคेเคฒ เคเคตं เค—ैเคธ เค•े เคฒिเค เคตिเคชเคฃเคจ เค”เคฐ เค•ीเคฎเคค (เคฎाเคฐ्เค•ेเคŸिंเค— เคंเคก เคช्เคฐाเค‡เคธिंเค—) เค•े เคฎाเคฎเคฒे เคฎें เค†เคœाเคฆी เคนोเค—ी। เค‡เคธ เคช्เคฐเค•्เคฐिเคฏा เคฎें เค‡เคธ เคฌाเคค เคธे เค•ोเคˆ เคช्เคฐเคญाเคต เคจเคนीं เคชเคก़ेเค—ा เค•ि เคฌेเคธिเคจ เค•ैเคธा เคนै। เค•ेंเคฆ्เคฐीเคฏ เคฎंเคค्เคฐिเคฎंเคกเคฒ เคจे 28 เคซเคฐเคตเคฐी เค•ो เคจिเคฏเคฎ เคฎें เคฌเคฆเคฒाเคต เค•ो เคฎंเคœूเคฐी เคฆी เคฅी। เค‡เคธเคฎें เค•เคนा เค—เคฏा เคนै เค•ि เคญเคตिเคท्เคฏ เคฎें เคธเคญी เคคेเคฒ เคเคตं เค—ैเคธ เค•्เคทेเคค्เคฐ เคฏा เคฌ्เคฒॉเค• เค•ा เค†เคตंเคŸเคจ เคช्เคฐाเคฅเคฎिเค• เคฐूเคช เคธे เค–ोเคœ เค•ाเคฐ्เคฏों เค•ो เคฒेเค•เคฐ เคœเคคाเคˆ เค—เคˆ เคช्เคฐเคคिเคฌเคฆ्เคงเคคा เค•े เค†เคงाเคฐ เคชเคฐ เค•िเคฏा เคœाเคเค—ा।เคจเค เคจिเคฏเคฎ เค•े เคคเคนเคค เค•ंเคชเคจिเคฏों เค•ो เคถ्เคฐेเคฃी-เคเค• ...

Follow the Page for Daily Updates!