Android quiz questions

Android interview questions

  • 1.

    When including a text file in your application to read from as a resource, what is the recommended location of such file?

    1. res/raw

    2. res/anim

    3. res/files

    4. res/values

    Answer
  • 2.

    Which of the following is correct about XML layoutfiles?

    1. In an Eclipse project using the ADT plugin, the XML layout file is found in the /res/layout directory.

    2. In order to display a UI defined in the XML layout file "main.xml", call the setContentView method of the Activity with the parameter string "main.xml".

    3. There is no distinction between implementation of the layout definition by code, or by XML layout file.

    4. Layout information written in the XML layout file will be converted into code by the Android platform when the screen is displayed.

    Answer
  • 3.

    Which of the following is incorrect about ProgressDialog?

    1. ProgressDialog inherits from the AlertDialog class.

    2. ProgressDialog can be freely configured to use a Drawable class to display as its progress bar.

    3. ProgressDialog can be set as 2 types of style:STYLE_HORIZONTAL and STYLE_SPINNER.

    4. ProgressDialog is able to apply a custom XML-defined layout by using the setContentView.(...) method.

    Answer
  • 4.

    An AsyncTask can be cancelled anytime from any thread.

    1. False

    2. True

    Answer
  • 5.

    Which of the following statements is correct about SQLite?

    1. It is client-server format.

    2. It is possible to create and access a database by using SQLOpenHelper.

    3. It is an object database.

    4. It can be accessed by other applications through ContentProvider.

    Answer
  • 6.

    Javascript is enabled by default in a WebView

    1. True

    2. False

    Answer
  • 7.

    Which of the following makes a ListView Clickable?

    1. setEnabled(true)

    2. SetItemsEnabled(true)

    3. setClickable(true)

    4. setVisibility(View.Visible)

    Answer
  • 8.

    Which method should you use to start a sub-activity?

    1. startSubActivity(Intent intent)

    2. startService(Intent intent)

    3. startActivityForResult(Intent intent)

    4. startActivity(Intent intent)

    Answer
  • 9.

    Which of these is not defined as a process state?

    1. Foreground

    2. Background

    3. Non-Visible

    4. Visible

    Answer
  • 10.

    What does this code do?

    Intent intent = new Intent();
    intent.setAction(Intent.ACTION_VIEW);
    intent.setData(android.net.Uri.parse("http://www.androidatc.com"));
    startActivity(intent);

     

    1. Starts a sub-activity

    2. Starts an activity using an implicit intent

    3. Starts a service

    4. Sends results to another activity

    Answer
  • 11.

    Which of the following tools dumps system log messages including stack traces when the device or emulator throws an error?

    1. Logcat

    2. DDMS

    3. ADB

    4. Console

    Answer
  • 12.

    What is a correct statement about an XML layout file?

    1. A file that contains all application permission information

    2. A file used to draw the content of an Activity

    3. A layout PNG image file

    4. A file that contains a single activity widget

    Answer
  • 13.

    Which of the following Activity life-cycle methods is called once the activity is no longer visible?

    1. onPause

    2. onDestroy

    3. onStop

    4. onHide

    Answer
  • 14.

    in which Activity life-cycle method you should do all of your normal static set up such as: creating views and bind data to lists?

    1. onStart()

    2. onPause()

    3. onResume()

    4. onCreate()

    Answer
  • 15.

    Which of the following are layout-related methods called by the framework on views, and you can override them when customizing a view? (Choose two)

    1. onMeasure().

    2. onDraw().

    3. onsizechanged().

    4. onKeyUp().

    Answer
  • 16.

    Which of the following Activity life-cycle methods is invoked when a dialog is shown?

    1. onPause()

    2. onStop()

    3. onDestroy()

    4. onCreate()

    Answer
  • 17.

    Which of following is incorrect about the Toast class?

    1. A Toast can only created by an Activity class

    2. There is no need to close or hide a Toast, since it closes automatically.

    3. You cannot set a custom layout for a Toast.

    4. A Toast is displayed for only one of the following periods: Toast.LENGHT_SHORT or Toast.LENGTH_LONG

    Answer
  • 18.

    When creating a file using android.content.Context.openFileOutput("test.txt", 0), where is the file created?

    1. /system/data/<package name>/files

    2. /data/data/<package name>/files

    3. /data/app/<package name>/files

    4. /system/app/<package name>/files

    Answer
  • 19.

    Which of these is the correct function of Traceview?

    1. Displays graphically the call stack.

    2. Displays graphically a memory acquisition and release log.

    3. Displays a graphical task execution log.

    4. Displays graphically the Ul state hierarchy.

    Answer
  • 20.

    Can create a custom view by extending class Activity?

    1. False

    2. True

    Answer

© 2017 QuizBucket.org