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 : A

Explanation

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

Answer : D

Explanation

We have to call startFordgroud(int id,Notification notification) to make services as foreground services. When it comes to foreground, it will show a notification.

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 : D

Explanation

The getContext() method is used in onCreate() method and getApplicationContext() can be used anywhere in an application.

Answer : E

Explanation

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

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()

Answer : A

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

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

Answer : A

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

Q 10 - What are the main components in android?

A - Activity

B - Services

C - Broadcast Receiver

D - Content provider

Answer : A,B,C and D

The main components in android are Activity, services, Broadcast Receiver and content providers.


android_questions_answers.htm

Advertisements