Android Online Quiz

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

A – Yes, a user can save all database updates in onStop()

B – No, a user can save in onSavedInstance()

C – No, a user can save in a Bundle()

D – No, In some situations, a user can’t reach onStop()

Answer : D

Explanation

Due to low memory problem. your application will close before reaching onStop()

Q 2 – On which thread services work in android?

A – Worker Thread

B – Own Thread

C – Main Thread

D – None of the above.

Answer : C

Explanation

Services, by default, work on Main thread. You can start services from any thread, but if you want to update the UI, you need to call Main thread.

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

A – START_STICKY

B – START_NOT_STICKY

C – START_REDELIVER_INTENT

D – All of the above

E – None of the above

Answer : D

Explanation

START_STICKY − If android stops services forcefully, using with START_STICKY, it can be restarted automatically without the user interaction.

START_NOT_STICKY − If android stops services forcefully, it will not restart services till user start services.

START_REDELIVER_INTENT − If android stops services forcefully, it will restart services by re-sending an intent.

Q 4 – What is the time limit of broadcast receiver in android?

A – 10 sec

B – 15 sec

C – 5 sec

D – 1 hour

Answer : A

Explanation

Broadcast receiver has to do operation within 10 sec or else ANR will occur

Q 5 -What is JNI in android?

A – Java network interface

B – Java interface

C – Image editable tool

D – Java native interface.

Answer : D

Explanation

Java Native interfaces are used to call native/cross applications, which are written in C and C++ languages.

Q 6 – What is a base adapter in android?

A – Base Adapter is a common class for any adapter, which can we use for both ListView and spinner

B – A kind of adapter

C – Data storage space

D – None of the above.

Answer : A

Base Adapter is a common class for any adapter. We can use a base adapter for both listView and spinner. It has some methods as shown below

getView()
getList()
getItem()
getCount()
Q 7 – What are the functionalities of HTTP Client interface in android?

A – Connection management

B – Cookies management

C – Authentication management

D – All of the above

E – None of the above

Answer : D

HTTP Client has the capabilities to manage connections, cookies and Authentication.

Q 8 – How many orientations does android support?

A – 4

B – 10

C – 2

D – None of the above

Answer : A

According to the Google documentation, Android supports 4 types of orientations, those are landscape, portrait, sensor and No orientation

Q 9 – What is the purpose of super.onCreate() in android?

A – To create an activity

B – To create a graphical window for subclass

C – It allows the developers to write the program

D – None of the above

Answer : B

The super.onCreate() will create the graphical window for subclasses and place at onCreate() method.

Q 10 – What is anchor view?

A – Same as list view

B – provides the information on respective relative positions

C – Same as relative layout

D – None of the above

Answer : B

Anchor View provides the information on respective relative positions of views.

Q 1 – Explain android activity life cycle?

A – onCreate() −> onStart() −> onActivityStarted() −> onResume() −> onPause() −> onStop() −> onActivityDistroy() −> onDestroy()

B – OnCreate() −> onStart() −>onResume() −> onPause() −> onStop() −> onRestart() −> onDestroy()

C – OnCreate() −> onStart() −> onPause() −> onResume() −> onStop() −> onDestroy()

D – −>onResume()

Answer : B

Explanation

OnCreate() − The system will call this,when an activity is created first time.

onStart() − The system will call this,when an activity starts the actions/action on UI.

onResume() − The system will call this, when onRestart() or onPause() is called.

onPause() −> The system will call this, when an activity going into the background.

onStop() − The system will call this, when an activity going into stop.

onRestart() − The system will call this, when an activity going to stop stage and to start the activity again.

onDestroy() − The system will call this, when an activity going in stop mode.

Q 2 – What are the layouts available in android?

A – Linear Layout

B – Frame Layout

C – Table Layout

D – Relative Layout

E – All of above

Answer : E

Explanation

Android is having Linear Layout(Horizontal and Vertical), Frame Layout, Table Layout, and Relative Layout.

Q 3 -How to pass the data from activity to services in android?

A – We can store the data in a common database and access the data on services as well as in Activity

B – We can’t pass data from activity to services.

C – Using putExtra() method in intent, we can pass the data using setResult()

D – A & C

E – None of the above

Answer : D

Explanation

Using putExtra() method, we can send the data. While using it, we need to call setResult() method in services. We can also store data in a common database and access it on services as well as in Activity.

Q 4 – What is the use of content provider in android?

A – To send the data from an application to another application

B – To store the data in a database

C – To share the data between applications

D – None of the above.

Answer : C

Explanation

Content provider is used to share the data between applications

Q 5 – What is singleton class in android?

A – A class that can create only one object

B – Anonymous class

C – Java class

D – Manifest file

Answer : A

Explanation

There is only an object which can be accessed by all other class.

Q 6 – What is ADB in android?

A – Image tool

B – Development tool

C – Android Debug Bridge

D – None of the above.

Answer : C

Android debug bridge is a client and a server modelled tool and acts as a bridge between client and server.

Q 7 – What is JSON in android?

A – Java Script Object Native

B – Java Script Oriented Notation

C – Java Script Object Notation

D – None of the Above

Answer : C

JSON is Java Script Object Notation with which we can exchange data between two systems in the connected network.

Q 8 – What is sandbox in android?

A – Each application runs securely in sandbox without interrupting another process

B – Android Box

C – Android development tool kit

D – None of the above

Answer : A

Each application runs securely in sandbox without interrupting another process. If an application is running in a sandbox, outside application can’t touch sandbox application

Q 9 – Is it mandatory to call onCreate() and onStart() in android?

A – No, we can write the program without writing onCreate() and onStart()

B – Yes, we should call onCreate() and onStart() to write the program

C – At least we need to call onCreate() once

D – None of the above

Answer : A

It is not mandatory, the program will work perfectly without fail, but the programmer has to implement the life cycle of activity.

10 – Can a class be immutable in android?

A – No, it can’t

B – Yes, Class can be immutable

C – Can’t make the class as final class

D – None of the above

Answer : B

Class can be immutable.

Q 10 – Can a class be immutable in android?

A – No, it can’t

B – Yes, Class can be immutable

C – Can’t make the class as final class

D – None of the above

Answer : B

Class can be immutable.

Q 1 – What is Pending Intent in android?

A – It is a kind of an intent

B – It is used to pass the data between activities

C – It will fire at a future point of time.

D – None of the Above

Answer : C

Explanation

Pending Intent is fired or triggered at a future point of time.

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

A – Margin is specifying the extra space left on all four sides in layout

B – Padding is used to offset the content of a view by specific px or dp

C – Both A and B are correct

D – None of the above

Answer : C

Explanation

Margin specifies the space left on four sides in the layout and padding specifies the exact position where the element going to be taking place in the layout.

Q 3 – What are the functionalities in asyncTask in android?

A – onPreExecution()

B – doInBackground()

C – onProgressUpdate()

D – onPostExecution()

E – onPostExecution()

Answer : E

Explanation

AsyncTask needs doInBackground() and remaining methods are optional. As a developer we should need to implement all methods which are given above.

Q 4 – What is the difference between content values and cursor in android SQlite?

A – Content values are key pair values, which are updated or inserted in the database

B – Cursor is used to store the temporary result.

C – A & B

D – Cursor is used to store data permanently.

E – Content values are used to share the data.

Answer : C

Explanation

Content values are named key pair values which is used to store the data, update the data in SQlite database. Cursor is a temporary buffering area to store the temporary result of android SQlite.

Q 5 – What is singleton class in android?

A – A class that can create only one object

B – Anonymous class

C – Java class

D – Manifest file

Answer : A

Explanation

There is only an object which can be accessed by all other class.

Q 6 – What is breakpoint in android?

A – Breaks the application

B – Breaks the development code

C – Breaks the execution.

D – None of the above.

Answer : C

Breaks the execution to find the debug value, It is one of the debugging techniques.

Q 7 – What is JSON in android?

A – Java Script Object Native

B – Java Script Oriented Notation

C – Java Script Object Notation

D – None of the Above

Answer : C

JSON is Java Script Object Notation with which we can exchange data between two systems in the connected network.

Q 8 – What is the JSON exception in android?

A – JSon Exception

B – Json Not found exception

C – Input not found exception

D – None of the above

Answer : A

Json exception can be thrown while parsing JSON response from the server.

Q 9 – How many protection levels are available in the android permission tag?

A – There are no permission tags available in android

B – Normal, kernel, application

C – Normal, dangerous, signature, and signatureOrsystem

D – None of the above

Answer : C

Android is having four levels of protection in android permission tag. They are normal, dangerous, signature, and signatureOrsystem

Q 10 – What is bean class in android?

A – A class used to hold states and objects

B – A bean class can be passed from one activity to another.

C – A mandatory class in android

D – None of the above

Answer : A

Bean class can hold other states and objects. It contains all fields which are private with setter and getter.

1 – What is an activity in Android?

A – Activity performs the actions on the screen

B – Manage the Application content

C – Screen UI

D – None of the above

Answer : A

Explanation

Activity is a single screen in an application, Activity performs the actions on the screen(UI)

Q 2 – On which thread services work in android?

A – Worker Thread

B – Own Thread

C – Main Thread

D – None of the above.

Answer : C

Explanation

Services, by default, work on Main thread. You can start services from any thread, but if you want to update the UI, you need to call Main thread.

Q 3 -How to stop the services in android?

A – finish()

B – system.exit().

C – By manually

D – stopSelf() and stopService()

Answer : D

Explanation

We can stop the services by stopSelf() and stopService(), in some cases android will kill the services due to the low memory problem.

Q 4 – What is the use of content provider in android?

A – To send the data from an application to another application

B – To store the data in a database

C – To share the data between applications

D – None of the above.

Answer : C

Explanation

Content provider is used to share the data between applications

Q 5 -What is the application class in android?

A – A class that can create only an object

B – Anonymous class

C – Java class

D – Base class for all classes

Answer : D

Explanation

Application class is the base class for any android application.

Q 6 – What is log message in android?

A – Log message is used to debug a program.

B – Same as printf()

C – Same as Toast().

D – None of the above.

Answer : A

The log message is used to debug a program. Some of log messages are shown below

log.d-Debugging log
log.i Informative log
log.e-Error log
log.w-Warning log
log.v-verbose log
Q 7 – What is the library of Map View in android?

A – com.map

B – com.goggle.gogglemaps

C – in.maps

D – com.goggle.android.maps

Answer : D

com.google.android.maps is the library of the map view in android. We can access google maps by calling this library.

Q 8 – How many orientations does android support?

A – 4

B – 10

C – 2

D – None of the above

Answer : A

According to the Google documentation, Android supports 4 types of orientations, those are landscape, portrait, sensor and No orientation

Q 9 – What is the purpose of super.onCreate() in android?

A – To create an activity

B – To create a graphical window for subclass

C – It allows the developers to write the program

D – None of the above

Answer : B

The super.onCreate() will create the graphical window for subclasses and place at onCreate() method.

Q 10 – What is off-line synchronization in android?

A – Synchronization with internet

B – Background synchronization

C – Synchronization without internet

D – None of the above

Answer : C

Synchronization without internet in which we can take the application data without internet.

Q 1 – How to get a response from an activity in Android?

A – startActivityToResult()

B – startActiivtyForResult()

C – Bundle()

D – None of the above

Answer : B
Explanation
startActivityForResult(Intent intent,int requestCode) will give the response from second activity to first activity as a result.
Q 2 – What is android view group?

A – Collection of views and other child views

B – Base class of building blocks

C – Layouts

D – None of the Above

Answer : A
Explanation
View Group is collaborating with views and other child views,It is an invisible container and base classes for layouts.
Q 3 – What is broadcast receiver in android?

A – It will react on broadcast announcements.

B – It will do background functionalities as services.

C – It will pass the data between activities.

D – None of the Above

Answer : A
Explanation
It is a main component of android. It reacts on the system broadcast announcements, and it acts as a gateway between outside application environment with your application.
Q 4 – What is the life cycle of broadcast receivers in android?

A – send intent()

B – onRecieve()

C – implicitBroadcast()

D – sendBroadcast(), sendOrderBroadcast(), and sendStickyBroadcast().

Answer : B
Explanation
Broadcast receiver has only onReceive() method. Broadcast starts from onRecieve() and control comes out from onRecieve().
Q 5 – What are the wake locks available in android?

A – PARTIAL_WAKE_LOCK

B – SCREEN_DIM_WAKE_LOCK

C – SCREEN_BRIGHT_WAKE_LOCK

D – FULL_WAKE_LOCK

E – FULL_WAKE_LOCK

Answer : E
Explanation
When CPU is on mode, PARTIAL_WAKE_LOCK will be active.

When CPU + bright Screen low is on mode, SCREEN_DIM_WAKE_LOCK will be active.

When CPU + bright Screen High is on mode,SCREEN_BRIGHT_WAKE_LOCK will be active.

When CPU, Screen, bright Screen High is on mode, FULL_WAKE_LOCK will be active.
Q 6 – What is log message in android?

A – Log message is used to debug a program.

B – Same as printf()

C – Same as Toast().

D – None of the above.

Answer : A
The log message is used to debug a program. Some of log messages are shown below

log.d-Debugging log
log.i Informative log
log.e-Error log
log.w-Warning log
log.v-verbose log

Q 7 – What is JSON in android?

A – Java Script Object Native

B – Java Script Oriented Notation

C – Java Script Object Notation

D – None of the Above

Answer : C
JSON is Java Script Object Notation with which we can exchange data between two systems in the connected network.
Q 8 – What is the HTTP response error code status in android?

A – status code < 100

B – status code > 100

C – status >= 400

D – None of the above

Answer : C
HTTP status code >= 400 means error else success. Status code 404 means page not found
Q 9 – What is the purpose of super.onCreate() in android?

A – To create an activity

B – To create a graphical window for subclass

C – It allows the developers to write the program

D – None of the above

Answer : B
The super.onCreate() will create the graphical window for subclasses and place at onCreate() method.
Q 10 – What is off-line synchronization in android?

A – Synchronization with internet

B – Background synchronization

C – Synchronization without internet

D – None of the above

Answer : C
Synchronization without internet in which we can take the application data without internet.

Q 1 – How to pass the data between activities in Android?

A – Intent

B – Content Provider

C – Broadcast receiver

D – None of the Above

Answer : A
Explanation
An Intent is used to connect one activity to another activity and having a message passing mechanism between activities.

Hide Answer
Q 2 – What is the life cycle of services in android?

A – onCreate()−>onStartCommand()−>onDestory()

B – onRecieve()

C – final()

D – Service life cycle is same as activity life cycle.

Answer : A
Explanation
Service life cycle is as onCreate()−>onStartCommand()−>onDestory().

Hide Answer
Q 3 – What are the functionalities in asyncTask in android?

A – onPreExecution()

B – doInBackground()

C – onProgressUpdate()

D – onPostExecution()

E – onPostExecution()

Answer : E
Explanation
AsyncTask needs doInBackground() and remaining methods are optional. As a developer we should need to implement all methods which are given above.

Hide Answer
Q 4 – What is sleep mode in android?

A – Only Radio interface layer and alarm are in active mode

B – Switched off

C – Air plane mode

D – None of the Above

Answer : A
Explanation
CPU will be in sleeping mode and it does not take any commands except radio interface layer and alarm from mobile.

Show Answer
Q 5 – Persist data can be stored in Android through

A – Shared Preferences

B – Internal/External storage

C – SQlite

D – Network servers.

E – All of above

Answer : E
Explanation
We can store persist data in android in shared preferences, internal/external storage, SQlite, and Network servers.

Show Answer
Q 6 – What is breakpoint in android?

A – Breaks the application

B – Breaks the development code

C – Breaks the execution.

D – None of the above.

Answer : C
Breaks the execution to find the debug value, It is one of the debugging techniques.

Hide Answer
Q 7 – What are the functionalities of HTTP Client interface in android?

A – Connection management

B – Cookies management

C – Authentication management

D – All of the above

E – None of the above

Answer : D
HTTP Client has the capabilities to manage connections, cookies and Authentication.

Hide Answer
Q 8 – What is a GCM in android?

A – Goggle Could Messaging for chrome

B – Goggle Count Messaging

C – Goggle Message pack

D – None of the above

Answer : A
Using with google could messaging, we can push the data from the servers to client devices. In short, we can send messages to mobile devices through the cloud(Push Notification).

Hide Answer
Q 9 – Is it mandatory to call onCreate() and onStart() in android?

A – No, we can write the program without writing onCreate() and onStart()

B – Yes, we should call onCreate() and onStart() to write the program

C – At least we need to call onCreate() once

D – None of the above

Answer : A
It is not mandatory, the program will work perfectly without fail, but the programmer has to implement the life cycle of activity.

Hide Answer
Q 10 – What is bean class in android?

A – A class used to hold states and objects

B – A bean class can be passed from one activity to another.

C – A mandatory class in android

D – None of the above

Answer : A
Bean class can hold other states and objects. It contains all fields which are private with setter and getter.

Q 1 – How to get a response from an activity in Android?

A – startActivityToResult()

B – startActiivtyForResult()

C – Bundle()

D – None of the above

Answer : B
Explanation
startActivityForResult(Intent intent,int requestCode) will give the response from second activity to first activity as a result.

Hide Answer
Q 2 – What is android view group?

A – Collection of views and other child views

B – Base class of building blocks

C – Layouts

D – None of the Above

Answer : A
Explanation
View Group is collaborating with views and other child views,It is an invisible container and base classes for layouts.

Hide Answer
Q 3 – What is broadcast receiver in android?

A – It will react on broadcast announcements.

B – It will do background functionalities as services.

C – It will pass the data between activities.

D – None of the Above

Answer : A
Explanation
It is a main component of android. It reacts on the system broadcast announcements, and it acts as a gateway between outside application environment with your application.

Hide Answer
Q 4 – What is the use of content provider in android?

A – To send the data from an application to another application

B – To store the data in a database

C – To share the data between applications

D – None of the above.

Answer : C
Explanation
Content provider is used to share the data between applications

Hide Answer
Q 5 – What are the wake locks available in android?

A – PARTIAL_WAKE_LOCK

B – SCREEN_DIM_WAKE_LOCK

C – SCREEN_BRIGHT_WAKE_LOCK

D – FULL_WAKE_LOCK

E – FULL_WAKE_LOCK

Answer : E
Explanation
When CPU is on mode, PARTIAL_WAKE_LOCK will be active.

When CPU + bright Screen low is on mode, SCREEN_DIM_WAKE_LOCK will be active.

When CPU + bright Screen High is on mode,SCREEN_BRIGHT_WAKE_LOCK will be active.

When CPU, Screen, bright Screen High is on mode, FULL_WAKE_LOCK will be active.

Hide Answer
Q 6 – What is log message in android?

A – Log message is used to debug a program.

B – Same as printf()

C – Same as Toast().

D – None of the above.

Answer : A
The log message is used to debug a program. Some of log messages are shown below

log.d-Debugging log
log.i Informative log
log.e-Error log
log.w-Warning log
log.v-verbose log
Hide Answer
Q 7 – What is an HTTP client class in android?

A – httprequest(get/post) and returns response from the server

B – Cookies management

C – Authentication management

D – None of the above

Answer : A
Http request has get and post methods and it returns the response from the servers.

Hide Answer
Q 8 – What is a GCM in android?

A – Goggle Could Messaging for chrome

B – Goggle Count Messaging

C – Goggle Message pack

D – None of the above

Answer : A
Using with google could messaging, we can push the data from the servers to client devices. In short, we can send messages to mobile devices through the cloud(Push Notification).

Hide Answer
Q 9 -What are return types of startActivityForResult() in android?

A – RESULT_OK

B – RESULT_CANCEL

C – RESULT_CRASH

D – A & B

E – B & C

Answer : D
strartActivityforResult() returns RESULT_OK and RESULT_CANCEL.

Hide Answer
Q 10 – What is a thread in android?

A – Same as services

B – Background activity

C – Broadcast Receiver

D – Independent dis-patchable unit is called a thread

Answer : D
The concurrent executable unit is called a thread. It’s performs some background functionalities with services.

(Visited 229 times, 1 visits today)