Deck 11: Using the Gps and Location Services

Full screen (f)
exit full mode
Question
For an app to retrieve the location of a device using its GPS, it needs to access Google Play services.
Use Space or
up arrow
down arrow
to flip the card.
Question
What file must be edited in order to include Google Play services in the compilation process?

A) MainActivity
B) AndroidManifest.xml
C) build.gradle
D) gradle
Question
The ____________ method of the Location class returns the longitude of a Location object.
Question
In what units does the getAccuracy method of the Location class return the accuracy of a Location object?

A) Miles
B) Kilometers
C) Meters
D) Feet
Question
Inside the AndroidManifest.xml file, what String constant of the Manifest.permission class can be used to specify an approximate location?

A) ACCESS_COARSE_LOCATION
B) ACCESS_FINE_LOCATION
C) ACCESS_PRECISE_LOCATION
D) ACCESS_CLOSE_LOCATION
Question
The startResolutionForResult method of the ConnectionResult class throws an exception.
Question
Several methods of the GoogleApiClient.Builder class return the GoogleApiClient object reference that called them so that method calls can be ____________.
Question
What method of the GoogleApiClient class do we call to close the connection with Google Play services?

A) close
B) stop
C) disconnect
D) quit
Question
The ____________ method of the LocationRequest class sets the priority level of the request for location updates.
Question
What is the name of the only method of the LocationListener interface?

A) onMoved
B) onLocationChanged
C) onChanged
D) locationChanged
Question
ConnectionCallbacks provides callback methods that are automatically called when we ____________ or are disconnected from the Google Play service.
Question
OnConnectionFailedListener provides a callback method that is automatically called if the connection attempt failed.
Question
One of the two methods of ConnectionCallbacks is onConnectionSuspended. What is the name of its other method?

A) onConnected
B) onSuspending
C) onSuspended
D) connect
Question
To call the requestLocationUpdates method, we need a FusedLocationProviderApi object reference. How can we get one?

A) FusedLocationProviderApi flpa = LocationServices.FusedLocationApi;
B) FusedLocationProviderApi flpa = LocationServices;
C) FusedLocationProviderApi flpa = FusedLocationApi;
D) FusedLocationProviderApi flpa = API;
Question
To get a GoogleApiClient reference, we can use the GoogleApiClient constructor.
Question
The LocationListener interface is part of the com.google.android.gms.location package.
Question
The Location class includes the getElapsedRealtimeNanos method, which returns the time since the last boot in nanoseconds, so we can compare the time between two location updates if we want to.
Question
Once location updates have been requested, it is not possible to stop them.
Question
The ConnectionCallbacks and OnConnectionFailedListener are static inner __________________ of the GoogleApiClient class.
Question
The __________________ method of the FusedLocationProviderApi interface returns the current location of the device as a Location reference.
Question
The __________________ method of the LocationRequest class sets the minimum distance between consecutive updates.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/21
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 11: Using the Gps and Location Services
1
For an app to retrieve the location of a device using its GPS, it needs to access Google Play services.
True
2
What file must be edited in order to include Google Play services in the compilation process?

A) MainActivity
B) AndroidManifest.xml
C) build.gradle
D) gradle
build.gradle
3
The ____________ method of the Location class returns the longitude of a Location object.
getLongitude
4
In what units does the getAccuracy method of the Location class return the accuracy of a Location object?

A) Miles
B) Kilometers
C) Meters
D) Feet
Unlock Deck
Unlock for access to all 21 flashcards in this deck.
Unlock Deck
k this deck
5
Inside the AndroidManifest.xml file, what String constant of the Manifest.permission class can be used to specify an approximate location?

A) ACCESS_COARSE_LOCATION
B) ACCESS_FINE_LOCATION
C) ACCESS_PRECISE_LOCATION
D) ACCESS_CLOSE_LOCATION
Unlock Deck
Unlock for access to all 21 flashcards in this deck.
Unlock Deck
k this deck
6
The startResolutionForResult method of the ConnectionResult class throws an exception.
Unlock Deck
Unlock for access to all 21 flashcards in this deck.
Unlock Deck
k this deck
7
Several methods of the GoogleApiClient.Builder class return the GoogleApiClient object reference that called them so that method calls can be ____________.
Unlock Deck
Unlock for access to all 21 flashcards in this deck.
Unlock Deck
k this deck
8
What method of the GoogleApiClient class do we call to close the connection with Google Play services?

A) close
B) stop
C) disconnect
D) quit
Unlock Deck
Unlock for access to all 21 flashcards in this deck.
Unlock Deck
k this deck
9
The ____________ method of the LocationRequest class sets the priority level of the request for location updates.
Unlock Deck
Unlock for access to all 21 flashcards in this deck.
Unlock Deck
k this deck
10
What is the name of the only method of the LocationListener interface?

A) onMoved
B) onLocationChanged
C) onChanged
D) locationChanged
Unlock Deck
Unlock for access to all 21 flashcards in this deck.
Unlock Deck
k this deck
11
ConnectionCallbacks provides callback methods that are automatically called when we ____________ or are disconnected from the Google Play service.
Unlock Deck
Unlock for access to all 21 flashcards in this deck.
Unlock Deck
k this deck
12
OnConnectionFailedListener provides a callback method that is automatically called if the connection attempt failed.
Unlock Deck
Unlock for access to all 21 flashcards in this deck.
Unlock Deck
k this deck
13
One of the two methods of ConnectionCallbacks is onConnectionSuspended. What is the name of its other method?

A) onConnected
B) onSuspending
C) onSuspended
D) connect
Unlock Deck
Unlock for access to all 21 flashcards in this deck.
Unlock Deck
k this deck
14
To call the requestLocationUpdates method, we need a FusedLocationProviderApi object reference. How can we get one?

A) FusedLocationProviderApi flpa = LocationServices.FusedLocationApi;
B) FusedLocationProviderApi flpa = LocationServices;
C) FusedLocationProviderApi flpa = FusedLocationApi;
D) FusedLocationProviderApi flpa = API;
Unlock Deck
Unlock for access to all 21 flashcards in this deck.
Unlock Deck
k this deck
15
To get a GoogleApiClient reference, we can use the GoogleApiClient constructor.
Unlock Deck
Unlock for access to all 21 flashcards in this deck.
Unlock Deck
k this deck
16
The LocationListener interface is part of the com.google.android.gms.location package.
Unlock Deck
Unlock for access to all 21 flashcards in this deck.
Unlock Deck
k this deck
17
The Location class includes the getElapsedRealtimeNanos method, which returns the time since the last boot in nanoseconds, so we can compare the time between two location updates if we want to.
Unlock Deck
Unlock for access to all 21 flashcards in this deck.
Unlock Deck
k this deck
18
Once location updates have been requested, it is not possible to stop them.
Unlock Deck
Unlock for access to all 21 flashcards in this deck.
Unlock Deck
k this deck
19
The ConnectionCallbacks and OnConnectionFailedListener are static inner __________________ of the GoogleApiClient class.
Unlock Deck
Unlock for access to all 21 flashcards in this deck.
Unlock Deck
k this deck
20
The __________________ method of the FusedLocationProviderApi interface returns the current location of the device as a Location reference.
Unlock Deck
Unlock for access to all 21 flashcards in this deck.
Unlock Deck
k this deck
21
The __________________ method of the LocationRequest class sets the minimum distance between consecutive updates.
Unlock Deck
Unlock for access to all 21 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 21 flashcards in this deck.