Android Programming - The Complete Practice Test Set 4

Can a user save all database updates in onStop ()?


Options are :

  • Yes, a user can save all database updates in onStop()
  • No, a user can save in onSavedInstance()
  • No, a user can save in a Bundle()
  • No, In some situations, a user can't reach onStop() (Correct)

Answer : No, In some situations, a user can't reach onStop()

How to kill an activity in Android?


Options are :

  • finish()
  • finishActivity(int requestCode)
  • A & B (Correct)
  • kill()
  • None of the Above

Answer : A & B

Android Programming - The Complete Practice Test Set 4

How to pass the data between activities in Android?


Options are :

  • Intent (Correct)
  • Content Provider
  • Broadcast receiver
  • None of the Above

Answer : Intent

What is a context in android ?


Options are :

  • It is an interface to store global information about an application
  • It is used to create new components.
  • Android has two contexts, those are getContext() and getApplicationContext()
  • All of Above (Correct)
  • None of Above

Answer : All of Above

What is Pending Intent in android?


Options are :

  • It is a kind of an intent
  • It is used to pass the data between activities
  • It will fire at a future point of time. (Correct)
  • None of the Above

Answer : It will fire at a future point of time.

Android Programming - The Complete Practice Test Set 4

What is android view group?


Options are :

  • Collection of views and other child views (Correct)
  • Base class of building blocks
  • Layouts
  • None of the Above

Answer : Collection of views and other child views

What are the layouts available in android?


Options are :

  • Linear Layout
  • Frame Layout
  • Table Layout
  • Relative Layout
  • All of above (Correct)

Answer : All of above

What is the difference between margin and padding in android layout?


Options are :

  • Margin is specifying the extra space left on all four sides in layout
  • Padding is used to offset the content of a view by specific px or dp
  • Both A and B are correct (Correct)
  • None of the above

Answer : Both A and B are correct

How many sizes are supported by Android?


Options are :

  • Android supported all sizes
  • Android does not support all sizes
  • Android supports small,normal, large and extra-large sizes (Correct)
  • Size is undefined in android

Answer : Android supports small,normal, large and extra-large sizes

Which of the following is/are are the subclasses in Android?


Options are :

  • Action Bar Activity
  • Launcher Activity
  • Preference Activity
  • Tab Activity
  • All of above (Correct)

Answer : All of above

What is Manifest.xml in android?


Options are :

  • It has information about layout in an application
  • It has the information about activities in an application
  • It has all the information about an application (Correct)
  • None of the above

Answer : It has all the information about an application

What is splash screen in android?


Options are :

  • Initial activity of an application
  • Initial service of an application
  • Initial method of an application
  • Initial screen of an application (Correct)

Answer : Initial screen of an application

What is the life cycle of services in android?


Options are :

  • onCreate()?>onStartCommand()?>onDestory() (Correct)
  • onRecieve()
  • final()
  • Service life cycle is same as activity life cycle.

Answer : onCreate()?>onStartCommand()?>onDestory()

On which thread services work in android?


Options are :

  • Worker Thread
  • Own Thread
  • Main Thread (Correct)
  • None of the above.

Answer : Main Thread

Android Programming - The Complete Practice Test Set 3

How to move services to foreground in android?


Options are :

  • Services always work in Foreground only
  • No,We can't do this query
  • Using startService(Intent intent)
  • startFordgroud(int id, Notification notification). (Correct)

Answer : startFordgroud(int id, Notification notification).

What are the functionalities of Binder services in android?


Options are :

  • Binder is responsible to manage the thread while using aidl in android
  • Binder is responsible for marshalling and un-marshalling of the data
  • A & B (Correct)
  • Binder is a kind of interface
  • None of the above

Answer : A & B

What is the difference between services and thread in android?


Options are :

  • Services performs functionalities in the background. By default services run on main thread only (Correct)
  • Thread and services are having same functionalities.
  • Thread works on services
  • None of the above

Answer : Services performs functionalities in the background. By default services run on main thread only

Android Programming - The Complete Practice Test Set 3

How to stop the services in android?


Options are :

  • finish()
  • system.exit().
  • By manually
  • stopSelf() and stopService() (Correct)

Answer : stopSelf() and stopService()

How to pass the data from activity to services in android?


Options are :

  • We can store the data in a common database and access the data on services as well as in Activity
  • We can't pass data from activity to services.
  • Using putExtra() method in intent, we can pass the data using setResult()
  • A & C (Correct)
  • None of the above

Answer : A & C

What are the return values of onStartCommand() in android services?


Options are :

  • START_STICKY
  • START_NOT_STICKY
  • START_REDELIVER_INTENT
  • All of the above (Correct)
  • None of the above

Answer : All of the above

Comment / Suggestion Section
Point our Mistakes and Post Your Suggestions