Android interview questions

In the year 2008 Android came as a popular computing platform, which is based on the Linux operating system. In the smartphone market, it became one of the most leading names that managed to change the whole. In the last ten years time, it grabs the majority of market share sharing with iOS and has effectively become the world most popular operating system. With the maturity of Android, it is finding its new way into a variety of devices, not just on smartphones but also includes televisions, projectors, automobiles and even now the vehicles.

Today with the advent of the Android platform, the Android developers are huge in demand and every sector and industry is looking to recruit them in-house. If you aspire to be an Android developer, then this is just the place for you. Given below is the list of questions, which answers both basic and advanced concepts of Android. These questions if well prepared before an interview shall give an extra edge to the candidate and give confidence of facing the panel:

Below is the list of 40+ Android Interview Questions with answers

  • Q1.

    What is Android?

    Posted by Sharad Jaiswal

    Android is an open-sourced operating system by Linux that is primarily used in mobile devices like cell phones and tablets. This Linux kernel based system is equipped with high and advanced components that allow developers to create and run apps. Therefore performs the basic as well as the advanced functions.

  • Q2.

    What are the Android application components?

    Posted by Sharad Jaiswal

    Android application components are the building block essentially used in the Android application. The application manifest file named Android manifest.xml couples the components. This describes each component of the application and describes how they interact, and then the processing activity takes place.

    There are four main components, which are:

    • Activities: They show the UI and handle the interaction of the users in smartphone screen.
    • Services: They take care of the processing associated with the application.
    • Broadcast Receivers: They handle the communication process between Android OS and application.
    • Content Providers: They handle issues with data and database management.
  • Q3.

    What does Fragment mean?

    Posted by Sharad Jaiswal

    A fragment means behavior or the portion of user interface in a Fragment Activity. One can combine multiple fragments in a single activity to build a UI and can reuse the fragment in multiple activities. The fragment can be considered as a modular section of an activity. This has its life cycle, gets its input events, which can be added or removed accordingly. It is must host a fragment in an activity and fragments lifecycle is directly related by the host activity’s lifecycle.

  • Q4.

    What options do the users get to save data in Android?

    Posted by Sharad Jaiswal

    Android provides some options to save or store the app data. Here the choice depends on the specific needs and requirement of space by the users.

    Few of the data storage options available on Android are as follows:

    • Internal file storage: stores the private file on the device file system.
    • External file storage: stores the file on the shared external file system.
    • Shared preferences: stores the private primitive data in key-value pairs.
    • Databases: stores the structured data in a private database.

    To expose one app’s data to other apps, the content provider can be used.

  • Q5.

    What is AIDL?

    Posted by Sharad Jaiswal

    AIDL is Android Interface Definition Language. This IDL allows the user to define the programming interface; both the clients and service agree upon to communicate with each other using inter-process communication (IPC). On Android platform, it becomes difficult for one processor to access the memory of another process. They need to decompose their objects into primitive that the operating system can manage, and marshal the objects across. The code to perform that marshaling is tedious to write therefore Android handles this for the users with the help of AIDL

  • Q6.

    What are services in Android and what is its type?

    Posted by Sharad Jaiswal

    Services here is an application component that can perform long-duration operations in the background. It doesn’t provide a user interface. Other application components can start a service and can continue to perform/ run in the background when the users switch to some other application. There are three different types of services:

    • Foreground: The activity of performing the operation in foreground service is noticeable to the users. A notification is displayed for the same.
    • Background: Generally, a background service performs its operations, which is directed not noticed by the users on their screen. Example if an app uses service to compact its storage this will be considered as background service.
    • Bound: A service is bound when an application component binds to it by calling it as bind service. A bound service runs only as long as another application component is bound to it.
  • Q7.

    What is the use of Android manifest.xml?

    Posted by Sharad Jaiswal

    Every application should have an Androidmanifest.xml file at the root of the project source set. This file describes the essential information required by the user for the app to the Android build tools. Apart from this, it is required for the following reasons:

    • To give permission that the application requires to ensure the access is protected.
    • To provide with the hardware and software features, which the app requires when installing from Google play etc.
  • Q8.

    What are launch modes?

    Posted by Sharad Jaiswal

    It is an instruction for Android OS that specifies how the activity should be launched or performed. The activities are performed into two areas, which are:

    • Tasks: It’s a collection of activities, with which the users interact when they perform certain jobs. An application contains a number of activities.
    • Back Stack: Back stack in a back stack the activities are arranged with the order in which each is opened. This maintained stack called back stack.
  • Q9.

    Explain sticky intent?

    Posted by Sharad Jaiswal

    Sticky intent sticks with the Android for future broadcast listeners. For instance, if Battery low event occurs then that intent will be stick with Android, so that if any future user requested for Battery – Low, it will be fired.

  • Q10.

    What is the difference between Serializable and parseable?

    Posted by Sharad Jaiswal

    Serializable is a standard Java interface. It is not a part of the Android SDK. Its simplicity is its biggest beauty. Just by implementing this interface the POJO will be ready to jump from one particular activity to another. There is another interface known as parseable. It is a part of the Android SDK. Paracelable was specifically designed in a way that there is no reflection left while using.

  • Q11.

    Give a brief idea about Android application architecture?

    Posted by Sharad Jaiswal

    The architecture of Android application has few components, which have their functions to perform:

    • Service: It performs the background functions
    • Intent: Performs the interconnection function between activities and data passing mechanism
    • Resource: Externalization it is used to perform strings and graphics functions
    • Notification: This shows the lights, sound, icon, notification, incoming chats messages dialogue box, etc.
    • Content providers: It shares the data between applications.
  • Q12.

    State the code names of Android along with the year when they were brought in?

    Posted by Sharad Jaiswal

    Following are the code names with year:

    1. Astro
    2. Blender
    3. Cupcake (April 2009)
    4. Doughnut (September 2009)
    5. Eclair (October 2009)
    6. Froyo (may 2010)
    7. Gingerbread (December 2010)
    8. Honeycomb (February 2011)
    9. Ice Cream Sandwich (October 2011)
    10. Jellybean (July 2012)
    11. Kitkat (October 2013)
    12. Lollipop (November 2014)
    13. Marshmallow (since October 2015)
  • Q13.

    State the advantages of Android?

    Posted by Sharad Jaiswal

    Advantages of Android are as follows:

    • It is an Open source that requires no licensing
    • It is Platform independent that supports Windows, Mac, and Linux platforms.
    • Supports different technologies like camera, Bluetooth, wifi, speech, EDGE, etc.
    • It is a highly optimized virtual machine.
  • Q14.

    What are the other languages that Android supports other than JAVA?

    Posted by Sharad Jaiswal

    Android supports C++, C. The app can be developed in C or C++ using Android NDK (Native development kit). This makes system works faster.

  • Q15.

    State the life cycle methods of Android activities?

    Posted by Sharad Jaiswal

    There are seven lifecycle methods of Android activities. They are:

    • On create()
    • On start()
    • On resume()
    • On pause()
    • On stop()
    • On restart()
    • On destroy()
  • Q16.

    What is DDMS?

    Posted by Sharad Jaiswal

    DDMS is Dalvik Debug Monitor Server.This gives a wide array of debugging features of which are

    • Port forwarding services
    • Screen capture
    • Thread and heap information
    • Network traffic tracking
    • Location data
    • spoofing
  • Q17.

    what dialogue boxes are supported by the Android box?

    Posted by Sharad Jaiswal

    Dialogue box supported by Android are:

    • Alert dialogue
    • Process dialogue
    • Data picker dialogue
    • Time picker dialogue
  • Q18.

    What are few exceptions in Android?

    Posted by Sharad Jaiswal

    These are the following exceptions in Android:

    • Inflate exception
    • Surface.out of resource exception
    • Surface holder bad surface type exception
    • Window manager took exception.
  • Q19.

    What are the tools used to develop an Android app?

    Posted by Sharad Jaiswal

    Tools used to develop an Android app are as follows:

    • JDK
    • Eclipse +ADT Plugin
    • SDK Tools
  • Q20.

    What is meant by Google Android SDK?

    Posted by Sharad Jaiswal

    The Google Android SDK is a set of tools that are used by the developers to write the app on Android-enabled devices. It contains a graphical interface that emulates an Android-driven handheld environment and allows the developers to debug their codes as per the requirements.

  • Q21.

    State the difference between a regular bitmap and nine- patch image?

    Posted by Sharad Jaiswal

    A nine- patch image allows the resizing of the image that can be used as background or other image size requirements for the target device. The nine- patch refers to the way one can resize the image. It can be done in the in the following manners

    • 4-image corner unscaled one.
    • Four edges, scaled in 1 axis
    • The last middle one that can be scaled into both the axes.
  • Q22.

    What is portable Wi-Fi hotspot?

    Posted by Sharad Jaiswal

    Portable Wi-Fi hotspot allows the users to share a mobile Internet connection with another device. Using an Android powered phone as a Wi-Fi hotspot user can use their laptop to connect to the Internet using the same access point.

  • Q23.

    State the importance of XML- based layouts?

    Posted by Sharad Jaiswal

    XML based layouts provide a consistent and standard means of setting GUI format. In general use, layout details are placed in XML files, and all other items are generally placed in a source files.

  • Q24.

    Explain Orientation?

    Posted by Sharad Jaiswal

    Orientation is set using set orientation (), dictates whether the linear layout is represented as a row or else as a column. There the values are set as HORIZONTAL or VERTICAL.

  • Q25.

    Differentiate between activities and services.

    Posted by Sharad Jaiswal

    Activities can be closed or can be terminated easily as and when the user wants to. Services are designed to run on the background or behind the scenes and can act independently. Most of the services run on a continuous basis regardless of their certain or no certain activities been executed.

  • Q26.

    State the importance of having an emulator with the Android environment?

    Posted by Sharad Jaiswal

    The emulator lets the developers “play” all around the interface that gives the experience of an actual mobile device. It is for writing and testing codes, and debug too. Emulators are safe for testing codes especially if the user is in the early stage of design.

  • Q27.

    What is the importance of settings permission in app development?

    Posted by Sharad Jaiswal

    Permission allows certain restrictions to be imposed primarily to protect data and code. Without this, codes could be compromised, resulting in defects in the actual function.

  • Q28.

    What is AAPT?

    Posted by Sharad Jaiswal

    AAPT is Android Asset packing tool. This provides developers with the ability to deal with zip-compatible archives, and it includes creating, extracting as well as viewing its content.

  • Q29.

    State few disadvantages of Android in the mobile market.

    Posted by Sharad Jaiswal

    Few of the disadvantages of Android in the mobile market are as follows:

    • Developers can write and register apps that will only run under the Android environment.
    • With the growing popularity and demand for the Android mobile devices, developers can easily take advantage of this trend by uploading the app on the market for the distribution purpose, and people can download it.
  • Q30.

    What are the four essential states of an activity?

    Posted by Sharad Jaiswal

    The four initial stages of the activity are as followed:

    • Active: If the activity is in the foreground that means it is running on the device.
    • Paused: When the activity is at the background and is still visible on the screen.
    • Stopped: when the activity is not visible and is actually hidden by another activity that is running on the device.
    • Destroyed: when the activation process is killed or is terminated, it’s considered to be completely destroyed.
  • Q31.

    What is meant by activities?

    Posted by Sharad Jaiswal

    Activities are windows to an interface. Like a window is created with the aim to display the output and to know about input in the form of a dialogue box. In the same manner, activities play its role, may not always in the form of a user interface.

  • Q32.

    Describe intents?

    Posted by Sharad Jaiswal

    Intents help to display the notification message to the user from within the Android device. Users are made to response this alert.

  • Q33.

    List few items, which you think may be important in every Android project?

    Posted by Sharad Jaiswal

    The important items for Android projects are:

    • AndroidManifest.xml
    • Build.xml
    • Bin/
    • Src/
    • Res/assets/
  • Q34.

    What are containers?

    Posted by Sharad Jaiswal

    In a general term, the container means some object that can be used to hold or to procure. In a similar manner here, containers are used to hold objects and the widgets altogether.It depends on which specific item is it required and what kind of arrangement is needed. It can be used to hold labels, fields or buttons.

  • Q35.

    What role has Dalvik played in Android development?

    Posted by Sharad Jaiswal

    Dalvik plays an important role in the development of Android. It acts as a virtual machine where the Android application runs. It is with the help of Dalvik only that devices can execute multiple virtual machines effectively along with better memory management.

  • Q36.

    Explain the steps in creating a bounded service through AIDL.

    Posted by Sharad Jaiswal

    Follow the below steps to create a bounded service through AIDL

    • Step 1. Create the .aidl file that defines the programming interface.
    • Step 2. Implement the interface, by extending the inner abstract stub class and imparting its methods.
    • Step 3. Expose the interface by implementing the service to the users.
  • Q37.

    State the importance of default resources.

    Posted by Sharad Jaiswal

    Default resources contain the default string and files. If this resource is not present the error will keep occurring, and the app will not be able to run. Resources are placed in subdirectories under the project res/ directory. Moreover, therefore helps the app to function in the desired conditions.

  • Q38.

    Explain fragment.

    Posted by Sharad Jaiswal

    Fragments are reusable in nature and is a portion of an activity. In other words, it is modular that can be combined or is movable in an activity.

  • Q39.

    When is it desirable to kill the foreground activity?

    Posted by Sharad Jaiswal

    Terminating or killing the foreground activity is the last and final savior. It is generally desirable or is the best time to kill this activity when it is consuming too much of memory. When the memory paging state is reached by the activity, it is killed so that the interface can sustain the responsiveness of the user of the application.

  • Q40.

    What is sticky intent?

    Posted by Sharad Jaiswal

    It is broadcast from sendstickybroadcasr() method. This allows the intent to float even after the broadcast and allowing others to collect data from.

  • Q41.

    Is the latest Android operating system supported in all mobile phones?

    Posted by Sharad Jaiswal

    The supporting facility of Android new version depends on the capabilities and specs of the phone. There are few Android power phones that allow the user to update their version to the higher operating version. Few don’t allow getting the updated version work. Either the new feature will not be supported, or the performance of the operating device will slow down.

  • Q42.

    What is a marshmallow in Android?

    Posted by Sharad Jaiswal

    In the latest update of Android version 6.0, the official Android code name is known as a marshmallow. It was launched in May 2015. This was the successor of the Android version 5.0 named as Lollipop. Google named this version as a marshmallow on 17th August 2015 for Nexus devices.