MCQ Chapter 3


Chapter 3
User Interface Design
1) Space outside of widget can be customized using
  1. padding
  2. height
  3. weight
  4. margins
Ans D: margins
2) Tab that shows hierarchy of project is
  1. Build variants
  2. Structure
  3. Favorites
  4. Project
Ans: B: Structure

3)  If a button is clicked whose method in Java is not defined then android application will
  1. do nothing
  2. crash
  3. show black screen
  4. get hang
Ans:B: crash

4) Android calculates pixels density of mobile (currently using app) using unit of measurement
  1. CP
  2. SP
  3. DP
  4. GP
Ans C:DP
5) In android studio, each new activity created must be defined in
  1. res/layout
  2. res/values
  3. Build.gradle
  4. AndroidManifest.xml
Ans:D: AndroidManifest.xml
6) A type of service provided by android that controls application lifespan and activity pile is
  1. Activity Manager
  2. View System
  3. Notifications Manager
  4. Content Providers
Ans:A: Activity Manager
7) Activity is needed to be stopped by doing any operation until resumed callback is called, type of callback is
  1. onPause
  2. onDestroy
  3. onResume
  4. onRestart
Ans:A: onPause
8) Property that is used for formatting font is
  1. Color
  2. typeface
  3. ImageView
  4. Mip Map
Ans:B: typeface

9) In android studio, currently open file location can be shown by
  1. navigation bar
  2. tool bar
  3. menu bar
  4. editor tab
Ans:A: navigation bar
10)  Considering following statement <br>protected void onCreated(Bund saveInstncState) {, onCreated is called
  1. method declaration
  2. method name
  3. method signature
  4. method call
Ans:B: method name
11) In android studio, callback that is called when activity restarts after being stopped is
  1. onStop
  2. onDestroy
  3. onRestart
  4. onResume
Ans:C: onRestart
12) Android library that provides access user interfaces' building blocks is
  1. android.webkit
  2. android.view
  3. android.os
  4. android.text
Ans:B: android.view

13 In android studio, callback that is called when activity is first time created is
  1. onResume
  2. onDestroy
  3. onCreate
  4. onStop
Ans:C: onCreate
14) Element of palette that holds multiple elements of specific purpose is called
  1. widgets
  2. containers
  3. textfields
  4. layouts
Ans:B: containers
15) If we want to refer another class functionality then android can know it only by declaring its name prior to use with reserve word
  1. package
  2. extend
  3. import
  4. protected
Ans:C: import
16)  In android studio, callback that enable system to destroy an activity is
  1. onRestart
  2. onCreate
  3. onStop
  4. onDestroy
Ans:D: onDestroy

17) In android studio, callback that is called when activity is visible is
  1. onCreate
  2. onDestroy
  3. onStop
  4. onStart
Ans:D: onStart
18) In android studio, callback that is when activity is no longer visible is
  1. onDestroy
  2. onStop
  3. onRestart
  4. onResume
Ans:B: onStop
19) A type of layout element that allows its children relative position depiction is
  1. RelativeLayout
  2. TextviewLayout
  3. LinearLayout
  4. ConstraintLayout
Ans:A: RelativeLayout
20) Right way to write java comments is
  1. //It is a comment
  2. \It is a comment
  3. /It is a comment
  4. \\It is a comment
Ans:A: //It is a comment





Comments