# MAD viva Question Bank (*Minimal Answers*) ## 1) What is android? Android is a mobile operating system based on a modified version of the Linux kernel and other open source software, designed primarily for touchscreen mobile devices such as smartphones and tablets. ## 2) Enlist Features of android? * Beautiul UI * Connectivity * Storage * Multi-Touch * Multi-Tasking * Multi-Language * Resizable widgets * Messaging * Media Support * Web Browser ## 3) Explain android architecture? 1. **Applications:** Applications is the top layer of android architecture. The pre-installed applications like home, contacts, camera, etc and third party applications will be installed on this layer only. 1. **Application framework:** Application Framework provides several important classes which are used to create an Android application. 1. **Application runtime:** Android Runtime environment contains components like core libraries and the Dalvik virtual machine(DVM). 1. **Platform libraries:** The Platform Libraries includes various C/C++ core libraries and Java based libraries such as Media, Graphics, OpenGL etc. to provide a support for android development. 1. **Linux Kernel:** The linux kernel manages all the available drivers such as display drivers, camera drivers, audio drivers, etc. which are required during the runtime. ## 4) Explain android sdk? 1. The Android SDK is the most important software of android which is installed. 1. The Android SDK provides to test android applications, the API libraries, an emulator, documentation, sample code, developers tools and tutorials which helps in building, testing and debugging apps for Android. 1. Android SDK is made up of two parts:`tools` and `packages`. ## 5) What is android AVD? An Android Virtual Device (AVD) is a configuration that defines the characteristics of an Android phone, tablet, Wear OS, Android TV, or Automotive OS device that you want to simulate in the Android Emulator. ## 6) What is emulator? The Android Emulator simulates Android devices on your computer so that you can test your application on a variety of devices and Android API levels without needing to have each physical device. ## 7) Difference between JVM and dVM? <!-- PLS dont change this Q.7th. It looks ugly, but output looks correct! --> | JVM | DVM | | -------- | -------- | | Supports multiple OS.| Supports android OS.| |Uses byte code and runs `.class` file | Use byte code and runs in `.dex` file.| |Executable is `JAR`. | Executable is `.APK`.| |Different Constant Pool for everyclass. | Constant Pool for every application. | |JVM runs on more memory. |DVM runs on less memory. | ## 8) What are activities? 1. Activities dictate the UI and handles the user interaction to the smart phone screen. 1. Activities represent a single screen that user interact. ## 9) What are services? 1. Android service is a component that is used to perform operations on the background such as playing music, handle network transactions, interacting content providers etc. 1. It doesn't has any UI (user interface). 1. The service runs in the background indefinitely even if application is destroyed. ## 10) What are intents(Implict and explicit intent)? Android Intent is the message that is passed between components such as activities, content providers, broadcast receivers, services etc. 1. **Implicit Intent:** Implicit Intent doesn't specifiy the component. In such case, intent provides information of available components provided by the system that is to be invoked. 1. **Explicit Intent:** Explicit intent specifies the component. In such case, intent provides the external class to be invoked. ## 11) Explain main Activity file, manifest and layout file? 1. **MainActivity:** It is the Java file that is automatically kept in this folder by Android studio all the classes will be available here and Android studio will even bundle together the package so that we can work with the file without having to go through all the folders. 1. **Manifest file:** It contains an Android manifest.xml file that is generated by Android studio when we create a project. This file contains the configuration parameters of a project such as Permission services and additional libraries. 1. **Layout file:** Layout specifies the various widgets to be used in the UI and the relationships between such widgets and their containers. Layout files are stored in "res/layout" in the Android application. ## 12) What are different types of UI compents(Textview, Edit text, button, progress bar)? 1. **TextView:** A TextView displays text to the user and optionally allows them to edit it. 1. **EditText:** A EditText is an overlay over TextView that configures itself to be editable. 1. **Button:** A Button is a Push-button which can be pressed, or clicked, by the user to perform an action. 1. **ProgressBar:** It is used to display the status of work being done like analyzing status of work or downloading a file, etc. ## 13) What are Layouts (LinearLayout, AbsoluteLayout, TableLayout, FrameLayout, RelativeLayout)? A layout defines the structure for a user interface in your app, such as in an activity. 1. **LinearLayout:** LinearLayout is a view group that aligns all children in a single direction, vertically or horizontally. 1. **AbsoluteLayout:** AbsoluteLayout enables you to specify the exact location of its children. 1. **TableLayout:** TableLayout is a view that groups views into rows and columns. 1. **FrameLayout:** The FrameLayout is a placeholder on screen that you can use to display a single view. 1. **RelativeLayout:** RelativeLayout is a view group that displays child views in relative positions. ## 14) Define: TextView, EditText, Button, ImageButton, CheckBox(attributes and methods)? 1. **TextView:** A TextView displays text to the user and optionally allows them to edit it. 1. **EditText:** A EditText is an overlay over TextView that configures itself to be editable. 1. **Button:** A Button is a Push-button which can be pressed, or clicked, by the user to perform an action. 1. **ImageButton:** This shows a button with an image (instead of text) that can be pressed or clicked by the user. 1. **CheckBox:** A CheckBox is an on/off switch that can be toggled by the user. ## 15) Explain ListView, GridView, ImageView, ScrollView? 1. **ListView:** List of scrollable items can be displayed in Android using ListView. It helps you to displaying the data in the form of a scrollable list. 1. **GridView:** It is a view group that display items in two dimensional scrolling grid, the grid items are not necessarily predetermined but they are automatically inserted to the layout using a ListAdapter. 1. **ImageView:** It is used to display an image file in application. 1. **ScrollView:** ScrollView is a view group that is used to make vertically scrollable views. ## 16) What is toast explain with example? 1. Toast is used to display information for a period of time. 2. It contains a message to be displayed quickly and disappears after specified period of time. 3. It does not block the user interaction. *Example:* ```xml.= toast.setGravity(Gravity.TOP | Gravity.LEFT, 0, 0); toast.setText("Changed Toast Text"); toast.show(); ``` ## 17) Explain activity lifecycle? 1. **onCreate():** This is the first callback and called when the activity is first created. 1. **onStart():** This callback is called when the activity becomes visible to the user. 1. **onResume():** This is called when the user starts interacting with the application. 1. **onPause():** The paused activity does not receive user input and cannot execute any code and called when the current activity is being paused and the previous activity is being resumed. 1. **onStop():** This callback is called when the activity is no longer visible. 1. **onDestroy():** This callback is called before the activity is destroyed by the system. 1. **onRestart():** This callback is called when the activity restarts after stopping it. ## 18) Explain broadcast receivers? 1. Broadcast Receivers simply respond to broadcast messages from other applications or from the system itself. 1. These messages are sometime called events or intents. 1. There are the two important steps to make BroadcastReceiver i.e.: - Creating the Broadcast Receiver - Registering Broadcast Receiver ## 19) Explain content provider? 1. A content provider component supplies data from one application to others on request. 1. A content provider can use different ways to store its data like images, audio, videos, and personal contact information and this data can be stored in a database, in files, or even over a network. ## 20) What is sensors? 1. Sensors can be used to monitor the three-dimensional device movement or change in the environment of the device. 1. Android provides sensor api to work with different types of sensors. ## 21) What is location based services? 1. Location-based services refers to services that are based on the location of a mobile user as determined by the device's geographical location. 1. Android location APIs make it easy for you to build location-aware applications. 1. This becomes possible with the help of Google Play services. ## 22) What is Geo code and reverse Geo code? 1. **Geo code:** Geocoding is the process of converting addresses into geographic coordinates, which you can use to place markers on a map, or position the map. 1. **Reverse Geo code:** Reverse geocoding is the process of converting geographic coordinates into a human-readable address. ## 23) Enlist Steps to publish android application? **Step 1:** First generate signed apk of your Android App to publish it on Play Store. **Step 2:** Sign up for Google Play Console to publish and manage your Android App. **Step 3:** Now click on Create Application. **Step 4:** Now fill store listing details of your App which include Title, Short and Full description. **Step 5:** Now Click on ready on publish along with save draft and click on Manage release. **Step 6:** After Manage production click on edit release. **Step 7:** Now click on review. **Step 8:** After review click on Start Rollout to production. ## 24) What is Date and time Picker? 1. **DatePicker:** Datepicker is a widget used to select a date. It allows to select date by day, month and year in your custom UI (user interface). 1. **TimePicker:** Timepicker is a widget used for selecting the time of the day in either AM/PM mode or 24 hours mode. The displayed time consist of hours, minutes and clock format.