Different results between Android Geocoder and Google Geocoding web service -


i creating android application , need use geolocation.

i have started using geocoder api android (android.location.geocoder) causes issues (timed out waiting response server) seems common according have read.

to make application work when kind of error occurs, use geocoding web service.

now, application works every time. problem results returned geocoder api , geocoder web service not same.

for example web service returns 3 addresses city name , country whereas geocoding api returns 8 addresses feature name, thoroughfare, locality...

the question is: there way make results web service same ones api?

edit

here maingeocoder class:

public class maingeocoder {      private geocoder geocoderapi;     private geocoderrest geocoderrest;      public maingeocoder(context context) {         geocoderapi = new geocoder(context);         geocoderrest = new geocoderrest(context);     }      public list<address> getfromlocationname(string search, int maxresults) {         list<address> addresses;         try {             addresses = geocoderapi.getfromlocationname(search, maxresults);             return addresses;         } catch (ioexception e) {             e.printstacktrace();             try {                 addresses = geocoderrest.getfromlocationname(search, maxresults);                 return addresses;             } catch (ioexception e1) {                 return null;             } catch (limitexceededexception e1) {                 return null;             }         }     } } 

it tries list of addresses api geocoder. if io exception thrown gets list web service using geocoderrest class has been pasted here: https://stackoverflow.com/a/15117087/3571822

is there way make results web service same ones api?

simply no. in majority of attempts there difference between these 2 geocoders. because android.location.geocoder uses service internally, can't track down in source code, never difference is, asking google. , don't think give info away.

btw, geocoderrest class use doesn't parse half of info contained in response. web service more reliable api in sdk.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -