Android Online Quiz


Advertisements


Following quiz provides Multiple Choice Questions (MCQs) related to Android. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Answer : C

Explanation

finish() − It is used to close the activity.

finish(int requestCode) − It is used to close the activity with requestCode.

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.

Answer : A

Explanation

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

Answer : C

Explanation

GPRS and Location provider is used to fetch the current location of a phone as longitude and latitude.

Q 6 - How many ports are allocated for new emulator?

A - 2

B - 0

C - 10

D - None of the above.

Answer : A

Every emulator or device is allocated by 2 ports based on port availability.

Q 7 - What does httpclient.execute() returns in android?

A - Http entity

B - Http response

C - Http result

D - None of the above.

Answer : B

Httpclient.execute() executes only once and it will return http response from the server or device, Http entity is embedded the body of the Http response.

Answer : C

Fragment life cycle is as shown below −

onAttach()
OnCreate()
onCreateView()
onActivityCreated()
onStart()
onResume()
onPause()
onStop()
onDestroyView()
onDestroy()
onDetach()

Answer : C

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

Answer : D

Set can't contain duplicate values. Examples of set are hashset,treeset and linked hash set

The list contains duplicate values. Example of list is linked list and array list


android_questions_answers.htm

Advertisements