Android App Development Test - 1
Android App Development Test-1
Questions
Suppose if we want to create an application of calculator, what type of layout is suitable?
- Framelayout
- Gridlayout
- Tablelayout
- Relativelayout
Android will place views on the left side of the screen. To change this, we use the _____________ attribute.
- Layout_gravity
- Gravity
- Alignment
- Gravity_layout
Which of the following is correct for relativelayout?
- The child views of a relative layout are arranged in the order they are declared.
- There is a circular dependency in a relative layout.
- We can set the width of the Relativelayout to wrap_content.
- We can set the height of the Relativelayout to wrap_content.
Which one of the following is not a layout container of Android?
- FrameLayout
- TableLayout
- LinearLayout
- CardLayout
Which of the following statements is/are true for ListView?
A. android.R.layout.simple_list_item_1 is used to display a single line of text in a row of ListView.
B. Android.R.layout.two_line_list_item displays two lines of text per row of a list.
- Only A
- Only B
- Both A and B
- Neither A nor B
GridLayout makes it easier to create a common “dashboard”-style UI seen in apps like Google+. We normally create such a UI using a Tablelayout, but GridLayout allows us to create the same layout with a ________________.
- same hierarchy
- ladder hierarchy
- flatter hierarchy
- bottom-top hierarchy
Which of the following attributes is used when we have a static unchanging list of values to populate the list view?
- Static
- Constant
- Entries
- Entry
Which of the following classes is used to simplify the process of loading the data and is available to all versions of Android through the compatibility package?
- Load
- Loader
- DataLoader
- DataLoad
____________ populate the elements of a ________ based on some internal data storage.
- ListAdapters and ListView
- ListView and ListAdapters
- LayoutInflater and ListView
- ListView and LayoutInflater
If you created an email application, any text entered by the user should be saved to your database during ______ callback.
- onCreate
- onPause
- onStop
- onResume
Which of the following codes is added to XML file for vertical linear layout?
- <Linearlayout android:layout_height=”wrap content” android:layout_width=”match parent”
android:layout_orientation=”horizontal”> - <Linearlayout android:layout_height=”wrap content” android:layout_width=”match parent”
android:orientation=”vertical”> - <Linearlayout android:layout_height=”wrap content” android:layout_width=”match parent”
android:orientation=0> - <Linearlayout android:layout_height=”wrap content” android:layout_width=”match parent”
android:orientations=”horizontal”>
Which of the following things should be remembered about activities?
A. The system will aggressively destroy your activity when it’s not visible to the user.
B. As all the callbacks run on the main thread, so you should not perform any long-running or computationally expensive operations in those callbacks.
- Only A
- Only B
- Both A and B
- Neither A nor B
Which of the following functions are used in Activity Life Cycle of Android?
- onCreate(), onStart(), onResume(), onPause(), onStop().
- onCreate(), onStart(), onResume(), onStop(), onDestroy().
- onCreate(), onResume(), onPause(), onStop(), nDestroy().
- onCreate(), onStart(), onResume(), onPause(), onStop(), onDestroy().
Which of the following APIs are not used to handle exception when we try to update the UI from one of our worker threads?
- The Activity.runOnUiThread method
- The View.post, View.postDelayed and View.postInValidate methods
- The AsyncTask class
- SyncTask class