Android UI Layouts and Database Programming

Test your knowledge of Android UI layouts, widgets, and database operations including SQLiteOpenHelper, Cursors, and storage management.

15 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

What is true about Frame Layout?

  1. Lets child views specify their position relative to the parent view or to each other
  2. Enables child views to specify their own exact x/y coordinates on the screen
  3. Aligns all children in a single direction - Vertically or Horizontally
  4. Its basically a blank space on screen that can be later filled with a single object
  5. None of above
Question 2 Multiple Choice (Single Answer)

The following method takes you to the root of the View Tree

  1. getParent()
  2. getRoot()
  3. getRootView()
  4. None of above
Question 3 Multiple Choice (Single Answer)

The root class of the RadioButton widget in hierarchy of Widgets is

  1. Button
  2. TextView
  3. CompoundView
  4. None of above
Question 4 Multiple Choice (Single Answer)

The following method gets the Id of the currently checked Radio Button.

  1. getRadioButtonId()
  2. getCheckedRadioButtonId()
  3. getCheckedId()
  4. None of above
Question 5 Multiple Choice (Single Answer)

Choose the correct xml representation of below highlighted java code: CheckBox cbox = new CheckBox(this); cbox.setChecked(true);

  1. Android:state_checked=”true”
  2. android: android:state_checked=”true”
  3. android:state=”true”
  4. android:android:state=”true”
  5. None of above
Question 6 Multiple Choice (Single Answer)

When the state of the CheckBox changes, you may register a listener object which is an instance of _________.

  1. onChangeListener()
  2. onCheckedChangeListener()
  3. onCheckBoxListener()
  4. None of above
Question 7 Multiple Choice (Single Answer)

Which of the following layout offers a grid Model?

  1. TableLayout
  2. LinearLayout
  3. RalativeLayout
  4. FrameLayout
  5. None of above
Question 8 True/False

Android defines two similar gravity attributes: android:gravity and android:layout_gravity. The android:gravity is a setting used by the container, whereas android:layout_gravity is used by the View.

  1. True
  2. False
Question 9 True/False

An interesting aspect of the FrameLayout is that if you add more than one control to the layout, the size of the layout is computed as the size of the largest item in the container.

  1. True
  2. False
Question 10 Multiple Choice (Single Answer)

By default, LinearLayout is _______.

  1. Left and top-aligned
  2. Only left aligned
  3. Only top aligned
  4. None of above
Question 11 Multiple Choice (Single Answer)

The android:layout_weight property indicates the proportion of the free space that should go to that widget. If you set it to be 1 for one widget and 2 for the other widget. How do you interpret this representation.

  1. Both Widgets will occupy the same free space.
  2. 2nd Widget will use twice the free space that 1st Widget takes
  3. 1st Widget will use twice the free space that 2nd Widget takes
  4. None of above
Question 12 Multiple Choice (Single Answer)

Android databases are stored in the _________folder on your device (or emulator)

  1. /data/data/<package_name>/databases
  2. /data/<package_name>/databases
  3. /data/data/databases
  4. None of above
Question 13 True/False

By default, all Android databases are private, accessible only by the application that created them.

  1. True
  2. False
Question 14 True/False

Queries in Android are returned as Cursor objects. Cursors are pointers to the result-set within the underlying data.

  1. True
  2. False
Question 15 Multiple Choice (Single Answer)

You can open and create database without SQLiteOpenHelper using

  1. Call OpenOrCreateDatabase()
  2. Call getReadableDatabase()
  3. Call getWriteableDatabase()
  4. None of above