The tutorial using Java to display Google Map user's current location is described at Android Google Map Displaying Current Location. The isLocationEnabled property of GoogleMap is used to enable location layer, which allows the device to interact with the current location. GoogleApiClient.OnConnectionFailedListener: This interface provides callbacks method onConnectionFailed(ConnectionResult) which is called when the error occurs while connecting the device to the service.GoogleApiClient.ConnectionCallbacks: This interface provides the callbacks methods onConnected(Bundle) and onConnectionSuspended(int) which are called when the device is connected and disconnected respectively.The abstract method onLocationChanged(Location) of LocationListener interface is called when the location has changed. LocationListener: This interface is used to receive the notification when the device location is changed.In the onMapReady(GoogleMap) method, we can add markers, listeners, and other attributes. The onMapReady(GoogleMap) method of OnMapRead圜allback interface is called when the map is ready to use.
0 Comments
Leave a Reply. |