Hello everyone welcome to knowledgesuttra. In the last blog of Android Development, we saw the Quick Guide ON Android Studio Installation. Before starting Application Development we have to know about Applications component. In the today’s blog, we get some idea about Application components and there application or work. This will help you to Develop Android Application. Other than that we will discuss Additional components which help you to make your Application more batter and efficient.
Before we go for the Applications component we have to know about the Manifest file. It is an xml file which describes how components interact and Manifest file tail about each component and their application. The components are loosely coupled by the application Manifest file. If we need to use any System components like camera, ringtone, wifi, etc. we have to take permission in the Manifest file. This will act as an interface between your application and the Android operating system. If your components are not declared in this file, they won’t be considered by the operating system.
Android Resources file
This is also important file in Development of Android Application. Is this use to manage all resources, you can manage other Resources apart from application code. It will use to manage resources like user interface string, colors, bitmaps, animation instruction, layout definitions, images, etc. these resources will be maintained in separate subdirectories.
Name of Components
- Broadcast Receivers
- Content Providers
All this are Application Components. We will discuss all these components in brief.
Activities: – Activity is nothing but the user interface and control of that UI to the smartphone screen. Activity represents a screen with a user interface. For example, everyone uses Whats app Application in their mobile phones you will better understand with this example, in Whats app you have one activity that shows a list of your chats, other activity to chat with the particular person, and one activity shows status. 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.
public class MainActivity extends Activity
Services: – A component that runs in the background to do tasks and operations which require Application. For example services like play music, camera, internet, SMS, etc. it does not disturb activity it work in background.
public class MyService extends Service
Broadcast Receivers: – Broadcast Receivers just react to broadcast messages from different applications or from the framework. For instance, applications can likewise start communicates to tell different applications that a few information has been downloaded to the device and is accessible for them to utilize, so this is communicated beneficiary who will catch this correspondence and will start a fitting activity.
public class MyReceiver extends BroadcastReceiver
Content Providers: – As the name Content provider it provides contents or Data from one application to other application on request. The requests are handled by the ContentResolver class. The data will be stored in the file system like database or somewhere else entirely.
public class MyContentProvider extends ContentProvider
All this are Application Components, other than that we are having some Additional Components as well which are used to construction of components and their logic.
Fragments: – Fragments will likely become a staple of almost every real app you make. They are so useful; there are so many reasons to use them; and once you get used to them, they are so simple. There is almost no reason not to use them.
Layouts: – Layouts are, as their name suggests, used to lay out all the other elements within them. What is key, however, and will become apparent as we progress, is how different layouts are more suited to different situations. In addition, we can use the same widgets on different types of layouts, and the XML code that will be generated for us will vary quite a lot.
Views: – Android provides a facility of Views in this we can give many types of views directly just like webView for the browser, imageView for Images, listView for the list,etc.
Intents: – In perhaps its most common use, an Intent object allows us to switch between activities. But, of course, activities are classes. So, what happens to their data when we switch between them? Intents handle this problem for us, as well, by allowing us to pass data between activities. For example, we could provide a link in our app for the user to send e-mail, make a phone call, interact with social media, and open a web page in a browser and have the e-mail, dialer, browser, or relevant social media app do all the work.
Hence we discuss Components and Additional components in this Blog if you have any quarry related to this topic you can ask in the Comment below.