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 Manifest file, we write info about hardware, all components of the app, permission our app need 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, a screen where you have UI for user login in-app you can call it’s your login Activity. Your app can have a number of Activities according to requirement. We can set layout in 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 in-app for which we don’t need UI(User Interface). Which task we want to perform on the background. Alarm Clock is one of the best example. In which you can use service. Because after we set alarm in the app it automatically triggers Notification on perfect time even in case of the inactive app. Because service check for time to ring the alarm and trigger Notification on the background. All our services will use a Service class as the parent class.
- Content Providers: The main purpose of content providers to share data with other applications. All our content provide class will is Content Provider as parent class.
- Intents: Intents are used to pass message 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 activity or service the broadcast receivers work as receiver to those Intents.
- Widgets: Widget is UI of application which you can set on the Home screen of Device. User 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 music player or we normally use google search widget on the home screen to search for things on the Internet.
- Notification: The main perform of Notification is to Notify user about something. For example whenever you get a new message your device show you have got a new message. Notifications are used to take attention of the user to your applications.