Android quiz questions

Android interview questions

  • 1.

    Which of the following is incorrect about the LogCat tool?

    1. Each log message has a tag

    2. You can create a log in your application using Log.v(String, String)

    3. Only one of your application can create log entries, and it should be component class (Activity, Service,...etc)

    4. A LogCat view is available as part of the ADT plugin of Eclipse

    Answer
  • 2.

    Which of the following is a rule that developers must always follow when writing multi-threaded Android applications? (Choose two)

    1. The UI thread must never be blocked.

    2. Each UI thread must not create more than one Worker thread.

    3. The Android Ul must not be accessed from outside the UI thread.

    4. A Worker thread must not be created from inside the UI thread.

    Answer
  • 3.

    Which of the following is a Java call-back method invoked when a view is clicked?

    1. OnTapListener

    2. OnClickDetector

    3. OnClickListener

    4. Detector

    Answer
  • 4.

    Which of the following classes is used by Intent to transfer data between different android component

    1. PendingIntent

    2. Bundle

    3. Extras

    4. Parcelables

    Answer
  • 5.

    Which of the following is the base class of all UI components?

    1. ViewGroup

    2. Layout

    3. View

    4. ListView

    Answer
  • 6.

    Which of the following is NOT true about class DefaultHttpClient?

    1. It supports HTTPS.

    2. It is only supported on Android versions 2.2 and older.

    3. It supports streaming uploads and downloads.

    4. It is Andriod's default implementation of an HTTP client.

    Answer
  • 7.

    What method you should override to use Android menu system?

    1. onMenuCreated()

    2. onCreateContextMenu()

    3. onCreateMenu()

    4. onCreateOptionsMenu()

    Answer
  • 8.

    What does the Src folder Contain?

    1. Java source Code files

    2. The application manifest file

    3. XML resource files

    4. Image and icon files

    Answer
  • 9.

    Which of the following methods is called in an Activity when another activity gets into the foreground?

    1. onDestroy()

    2. onPause()

    3. onExit()

    4. onStop()

    Answer
  • 10.

    Which of the following is NOT true about SQLiteOpenHelper class? (Choose two)

    1. It manages database creation and updates.

    2. It has two abstract methods: oncreate() and onUpgrade().

    3. It manages database Versions using ContentProvider.

    4. It is used to perform database querying.

    Answer
  • 11.

    Which of the following is NOT a correct constructer for ArrayAdapter?

    1. ArrayAdapter (Context context, int resourse)

    2. ArrayAdapter (Context context, int resource, List<T> items)

    3. ArrayAdapter (Context context, int resource, int textViewResourceld)

    4. ArrayAdapter (Context context)

    Answer
  • 12.

    Which of the following is NOT true about a content provider?

    1. It facilitates access to Android's SQLite databases.

    2. It manages access to structured data.

    3. It cannot be used from inside an Activity.

    4. To access data in it, method getContentResolver() of the application's Context is used.

    Answer
  • 13.

    Which package of the following does not have classes needed for Android network connections?

    1. org.apache.http

    2. android.location

    3. java.net

    4. android.net

    Answer
  • 14.

    What does the following line of code do?

    Toast toast = Toast.makeText(this,"Android ATC", Toast.LENGTH_LONG);
    toast.setGravity(Gravity.TOP|Gravity.RIGH, 0, 0);

     

    1. The toast will show the text message on top-right corner of the toast box.

    2. The toast will appear on the top-right corner

    3. The toast will appear at the center of the screen at position(0,0), but aligned to the top-right corner.

    4. The toast will have it Ul components place on the top-right corner.

    Answer
  • 15.

    What best explains the code above?

    Intent i = new Intent(this, MainActivity.class);
    i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    startActivity(i);

    A. A new Activity will be launched and it will be on the top of the stack.

    B. Any existing task that would be associated with the activity to be cleared before the activity is started.

    C. The activity being launched is already running in the current task, then instead of launching a new instance of that activity, all of the other activities on top of it
    will be closed and this intent will be delivered to the (now on top) old activity as a new intent.

    D. A new activity will be launched but will be in full-screen mode.

    1. A

    2. B

    3. C

    4. D

    Answer
  • 16.

    Which of these files contains text values that you can use in your application?

    1. res/values/strings.xml

    2. res/Text.xml

    3. AndroidManifest.xml

    4. res/layout/Main.xml

    Answer
  • 17.

    When using an implicit intent, what process does the system use to know what to do with it?

    1. Intent transition

    2. Intent resolution

    3. Intent overloading

    4. Intent declaration

    Answer
  • 18.

    Which of the following add a click listener to items in a listView?

    1. onItemClicked

    2. onItemClickListener

    3. onListItemClickListener

    4. onClickListener

    Answer
  • 19.

    Which of the following is not a valid Android resource file name?

    1. myLayout.xml

    2. my_layout.xml

    3. mylayout1.xml

    4. mylayout.xml

    Answer
  • 20.

    Which is the correct explanation of ListView?

    1. ListView has a function to display a list of uniquely defined Views other than TextView.

    2. You cannot use a ListView when there is no information to be displayed.

    3. When displaying a list of Strings using an ArrayAdapter class in ListView, you must save the value in an ArrayList.

    4. It is necessary to use ListView as a set with ListActivity.

    Answer

© 2017 QuizBucket.org