I am new to Android & I am learning how to use Geocoder
What i have done::
My Questions::
Which one is better to use Distance matrix or Geocoder ?
The Geocoder and the Distance Matrix API are for different use cases.
With the android.location.Geocoder you will get the coordinates for a specific street name f.e. If you provide the city/street name/administrative areas etc. it will responde a pair of latitude and longitude. This is also possible for the other way around called reverse geocoding. If you provide the latitude and longitude it will responde the fitting street name.
The Distance Matrix API will responde the duration and the distance to reach a destination from an origin. To be exact, this API will take multiple origins and destinations and computes the distance and duraton for them.
Can GeoCoder fetch me location details if i don't use MAP-API in my mobile ?
The Geocoder is part of the android.location
package, hence you don't need the com.google.android.gms.maps
library.
Can geocoder fetch location information directly from internet ?
Yes, but you have to use the Geocoding API. The Geocoder from the SDK is communicating directly with Google Services.