• Android Video Tutorials

Android Mock Test



This section presents you various set of Mock Tests related to Android. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.

Questions and Answers

Android Mock Test III

Answer : C

To find the last known location of a phone we need to use LastKnownLocation, the syntax is as shown below.

Location location = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);

Q 2 - WHich method is used to find GPS enabled or disabled pro-grammatically in android?

A - finish()

B - getGPSStatus()

C - onProviderDisable()

D - getGPS().

Answer : C

The onProviderDisable() method is used to find whether GPS is enabled or disabled in android pro-grammatically

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

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

Answer : D

DDMS provides port forwarding, screen capturing, memory mapping, logcat, calls, SMS etc.

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

Answer : C

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

Q 8 - 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.

Answer : C

APK is an android packaging kit. We can pack/zip, our code in apk format to work on Android devices as an application.

Q 10 - What are the debugging techniques available in android?

A - DDMS

B - Breaking point

C - Memory profiling

D - None of the above.

E - None of the above.

Answer : D

DDMS, Breaking Point and Memory profiling are the three debugging techniques available in Android. Based on requirement, we can use debugging techniques, each technique is having different capabilities to debug.

Answer : B

Using with log cat, we can find the exception, which has occurred along with the line number. Using of line number, we can find the errors.

Answer : D

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

Answer : A

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

Q 14 - 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.

Q 15 - What is the package name of JSON?

A - com.json

B - in.json

C - com.android.JSON

D - org.json

Answer : D

org.json is the package name of JSON object and JSON array

Q 16 - What is the package name of HTTP client in android?

A - com.json

B - org.apache.http.client

C - com.android.JSON

D - org.json

Answer : B

org.apache.http.client is the package name of HTTP client.

Q 17 - Data can be read from local source XML in android through

A - XML resource parser

B - XML pull parsing

C - DOM parsing

D - None of the above

Answer : A

Using with XML resource parser, we can read local resource XML in android.

Q 18 - 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 19 - In which technique, we can refresh the dynamic content in android?

A - Java

B - Ajax

C - Android

D - None of the Above

Answer : B

Using with Ajax technology, we can refresh the dynamic data in web pages.

Answer : C

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

Answer : D

Json elements are Number, string, boolean, null, array, and object

Q 22 - 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

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

Q 24 - How to find the JSON element length in android JSON?

A - count()

B - sum()

C - add()

D - length()

Answer : D

Using length(), we can find the number of elements are in JSON.

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

Answer Sheet

Question Number Answer Key
1 C
2 C
3 A
4 C
5 D
6 A
7 C
8 A
9 C
10 D
11 B
12 D
13 A
14 B
15 D
16 B
17 A
18 D
19 B
20 C
21 D
22 C
23 A
24 D
25 A
android_questions_answers.htm
Advertisements