Android Application Components
In this tutorial, we will learn basic Android Application Components. Every android app has some basic components and we mention all these components in the Android Manifest file. In the Manifest file, we write info about hardware, all components of the app, permission our app needs, etc. In the next tutorial, we will learn about the Android Manifest file in detail. Here we will learn all the basic android components.
List of Basic Android Application Components :
- Content Providers
- Broadcast Receivers
Activities: We can describe an Activity as a single screen of your application. For example, on a screen where you have UI for user login in the app, you can call it your login Activity. Your app can have several activities according to requirements. We can set the layout in the Activity using Views or Fragments(We will learn these topics in detail in upcoming tutorials). Remind it all the Activities have Activity class as parent class.
Services: We can create services for those works which don’t need UI(User Interface). The task we want to perform in the background. The alarm clock is one of the best examples. Because after we set an alarm in the app it automatically triggers a notification on perfect time even if the app is not forground. Because the service checks for the time to ring the alarm and trigger Notification in the background. All our services will use a Service class as the parent class.
Content Providers: The main purpose of content providers is to share data with other applications. All our content provide classes has Content Provider as parent class.
Intents: Intents are used to pass messages throughout Android. We can use these intents to start or stop an activity or service. This activity or service may be from our app or maybe from another app.
Broadcast Receivers: When we pass an Intent to an activity or service the broadcast receivers work as receivers of those Intents.
Widgets: The widget is the UI of the application which you can set on the Home screen of the Device. Users can interact from that UI with your app. For example, you can set the music player widget on your home screen from where you can control the music player or we normally use the google search widget on the home screen to search for things on the Internet.
Notification: The main function of Notification is to notify then user about something. For example, whenever you get a new message your device shows you have got a new message. Notifications are used to take the attention of the user to your applications.
Spread the love:
Please share this page on social media with your friends..