java - RPC Error with Geocoder -


after several days learn how android works, decided build first app : simple app displays gmap address provided user simple edittext widget.
use geocoder that.

after little bugtracking logcat, here exception returned adb :

e/locationmasfclient(   53): forwardgeocode(): rpc failed status 1 w/system.err(  262): java.io.ioexception: rpc failed status 1 w/system.err(  262):    @   android.location.geocoder.getfromlocationname(geocoder.java:166) w/system.err(  262):    @ fr.meetopia.tinymap.mapviewactivity.testgeocoder(mapviewactivity.java:104) w/system.err(  262):    @ fr.meetopia.tinymap.mapviewactivity.oncreate(mapviewactivity.java:38) w/system.err(  262):    @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1047) w/system.err(  262):    @ android.app.activitythread.performlaunchactivity(activitythread.java:2459) w/system.err(  262):    @ android.app.activitythread.handlelaunchactivity(activitythread.java:2512) w/system.err(  262):    @ android.app.activitythread.access$2200(activitythread.java:119) w/system.err(  262):    @ android.app.activitythread$h.handlemessage(activitythread.java:1863) 

and here code pointed stack trace :

geocoder geocoder = new geocoder(this); mapview mapview = (mapview) findviewbyid(r.id.mapview);     mapcontroller mc = mapview.getcontroller();     geopoint p;     try {         list<address> addresses = geocoder.getfromlocationname("paris france", 50);         if (addresses.size() > 0) {             p = new geopoint(                     (int) (addresses.get(0).getlatitude() * 1e6),                      (int) (addresses.get(0).getlongitude() * 1e6));             mc.animateto(p);                 mapview.invalidate();         }     } catch (exception e) {         // todo auto-generated catch block         e.printstacktrace();     } 

obviously, code portion of mapactivity instantiation.

i made tests different versions of google apis (8, 7, 4) , different versions of sdk platform (2.2, 2.1, 1.6), no luck. noticed google api 8 contains known bug , returned service unavailable exception instead of rpc failed 1.

on other hand, tried run app directly on device (htc desire 2.1) , noticed same behavior (that say: no behavior, map usa in center).

here comes user-permission of android manifest :

<uses-permission android:name="android.permission.access_fine_location" /> <uses-permission android:name="android.permission.access_coarse_location" /> <uses-permission android:name="android.permission.internet" /> 

please visit post can't mark while showing current location in 'mapview' think prior modification can able whatever aim for.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -