Android Interview Questions Part-1

When you go for an interview, then a lot of questions in your mind. This article will help you about interviewers questions.

Q-1: What are the different Android components?
Ans: The Android components are Activities, Intents, Services, Broadcast Receivers, and Content Providers.
Q-2: How does Android System understand which layout file is not be shown?
Ans: Android System will look into the Manifest.xml file. Then System will go for intent-filter. After that look into Activity and activity method setContentView() and by using this method, System will inflate the layout file.
Q-3: List out some characteristics of Activity?
Ans: Activity has the following characteristics

  1. Activity is always associated with UI.
  2. No two UI can have the same Activity or vice-versa.
  3. The activity has its own lifecycle.

Q-4: What is Activity Lifecycle?
Ans: An Activity is a single screen in Android. Activity Lifecycle contains on following methods

  1. onCreate(): This method called when Activity starts the first time.
  2. onStart(): This method called when an Activity visible to the user.
  3. onResume(): This method called when onStart() method finished or when an Activity come back from background to foreground.
  4. onPause(): This method called when an Activity goes from foreground to background.
  5. onStop(): This method called after onPause() method finished or you can say this method called when an Activity no longer visible to the user.
  6. onRestart(): This method calls the onDestroy() method to destroy an Activity.
  7. onDestroy(): This method called before the Activity destroyed.

Q-5: What is Intent?
Ans: An Intent is the message object which we use for communication between the Android components. The intent has two types

  1. Implicit Intent
  2. Explicit Intent

you can read more about Intent and its types from here.

Q-6: Explain the purpose and structure of the manifest file?
Ans: Manifest provides essential information about your app to Android System. In the Manifest file, we tell the Android system about app permissions, services, receivers, activities and meta information which we use in our app.

Q-7: What is Material Design?
Ans: Material design introduced in Lollipop Android OS. The purpose of material design to provide decent look and user friendly UI in Theme, widgets, custom shadows and animations and vector drawable.

Q-8: How to implement Google Material design in an Android Application?
Ans:
Google material design implement by using color customization. We can customize color by using the following attributes which are colorPrimary, colorPrimaryDark and accentColor. The colorPrimary use in Android ActionBar. colorPrimaryDark use for Android status bar. The accentColor use for the default color of EditTextField, spinner, radio button, etc. We can implement Google material in SVG drawable, custom animation and much more.
Click here to see Material design examples.

Q-9: What is the Android floating button?
Ans:
Basically its small UI in a circular shape. It basically uses for animating the behavior on the screen or maybe expending the piece of material. This button floats UI in a circular shape with some actions attached to it.

Q-10: What is Android Toolbar?
Ans:
Android Toolbar is the improved type of Actionbar with some extra functionalities.

Q-11: What are Snackbar and Toast?
Ans:
Snackbar is just like a Toast message except they provide action to interact with. Snackbar display at the bottom of the screen and can be swiped off in order to dismiss them.
Toast is a small message which displays on the screen like a tooltip. Toast message disappears after a short delay like Snackbar. Toast messages cannot be swiped like Snackbar.

Leave a Reply

Your email address will not be published. Required fields are marked *