Android interview questions

Android quiz questions

  • 1.

    What is the AndroidManifest.xml?

    Answer:

    This file is essential in every application. It is declared in the root directory and contains information about the application that the Android system must know before the codes can be executed.

    View
  • 2.

    What role does Dalvik play in Android development?

    Answer:

    Dalvik serves as a virtual machine, and it is where every Android application runs. Through Dalvik, a device is able to execute multiple virtual machines efficiently through better memory management.

    View
  • 3.

    How can the ANR be prevented?

    Answer:

    One technique that prevents the Android system from concluding a code that has been responsive for a long period of time is to create a child thread. Within the child thread, most of the actual workings of the codes can be placed, so that the main thread runs with minimal periods of unresponsive times.

    View
  • 4.

    What are the different states wherein a process is based?

    Answer:

    There are 4 possible states:
    – foreground activity
    – visible activity
    – background activity
    – empty process

    View
  • 5.

    Is there a case wherein other qualifiers in multiple resources take precedence over locale?

    Answer:

    Yes, there are actually instances wherein some qualifiers can take precedence over locale. There are two known exceptions, which are the MCC (mobile country code) and MNC (mobile network code) qualifiers.

    View
  • 6.

    When is the onStop() method invoked?

    Answer:

    A call to onStop method happens when an activity is no longer visible to the user, either because another activity has taken over or if in front of that activity.

    View
  • 7.

    Enumerate the three key loops when monitoring an activity

    Answer:

    – Entire lifetime – activity happens between onCreate and onDestroy
    – Visible lifetime – activity happens between onStart and onStop
    – Foreground lifetime – activity happens between onResume and onPause

    View
  • 8.

    What is the function of an intent filter?

    Answer:

    Because every component needs to indicate which intents they can respond to, intent filters are used to filter out intents that these components are willing to receive. One or more intent filters are possible, depending on the services and activities that is going to make use of it.

    View
  • 9.

    What is the importance of settings permissions in app development?

    Answer:

    Permissions allow certain restrictions to be imposed primarily to protect data and code. Without these, codes could be compromised, resulting to defects in functionality.

    View
  • 10.

    How are escape characters used as attribute?

    Answer:

    Escape characters are preceded by double backslashes. For example, a newline character is created using ‘\\n’

    View
  • 11.

    Which elements can occur only once and must be present?

    Answer:

    Among the different elements, the and elements must be present and can occur only once. The rest are optional, and can occur as many times as needed.

    View
  • 12.

    What is ANR?

    Answer:

    ANR is short for Application Not Responding. This is actually a dialog that appears to the user whenever an application have been unresponsive for a long period of time.

    View
  • 13.

    What are the four essential states of an activity?

    Answer:

    – Active – if the activity is at the foreground
    – Paused – if the activity is at the background and still visible
    – Stopped – if the activity is not visible and therefore is hidden or obscured by another activity
    – Destroyed – when the activity process is killed or completed terminated

    View
  • 14.

    What is adb?

    Answer:

    Adb is short for Android Debug Bridge. It allows developers the power to execute remote shell commands. Its basic function is to allow and control communication towards and from the emulator port.

    View
  • 15.

    What do you think are some disadvantages of Android?

    Answer:

    Given that Android is an open-source platform, and the fact that different Android operating systems have been released on different mobile devices, there’s no clear cut policy to how applications can adapt with various OS versions and upgrades. One app that runs on this particular version of Android OS may or may not run on another version. Another disadvantage is that since mobile devices such as phones and tabs come in different sizes and forms, it poses a challenge for developers to create apps that can adjust correctly to the right screen size and other varying features and specs.

    View
  • 16.

    What is the importance of Android in the mobile market?

    Answer:

    Developers can write and register apps that will specifically run under the Android environment. This means that every mobile device that is Android enabled will be able to support and run these apps. With the growing popularity of Android mobile devices, developers can take advantage of this trend by creating and uploading their apps on the Android Market for distribution to anyone who wants to download it.

    View
  • 17.

    What is Orientation?

    Answer:

    Orientation, which can be set using setOrientation(), dictates if the LinearLayout is represented as a row or as a column. Values are set as either HORIZONTAL or VERTICAL.

    View
  • 18.

    What are containers?

    Answer:

    Containers, as the name itself implies, holds objects and widgets together, depending on which specific items are needed and in what particular arrangement that is wanted. Containers may hold labels, fields, buttons, or even child containers, as examples.

    View
  • 19.

    What is the importance of XML-based layouts?

    Answer:

    The use of XML-based layouts provides a consistent and somewhat standard means of setting GUI definition format. In common practice, layout details are placed in XML files while other items are placed in source files.

    View
  • 20.

    What items are important in every Android project?

    Answer:

    These are the essential items that are present each time an Android project is created:
    – AndroidManifest.xml
    – build.xml
    – bin/
    – src/
    – res/
    – assets/

    View

© 2017 QuizBucket.org