I need to get address from lon lat location. I was trying with geodecoder but it doesn’t work (throws Service Not Available). Is there any other solution to that problem?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The geocoder is not guaranteed to exist on all devices. Couple of things to try:
The documentation is not exactly clear, but it seems that if you have the Google add-ons, you should have a geocoder backend implementation. Try linking against the Google APIs for your target API level (see below)
https://stackoverflow.com/a/2255592/483708
In your implementation, prevent erroneous results by explicitly checking for geocoding functionality with
Geocoder.isPresent()http://developer.android.com/reference/android/location/Geocoder.html#isPresent()
If the above points are insufficient, you will need to use the Google Maps Web APIs to perform reverse geocoding via the web:
http://code.google.com/apis/maps/documentation/geocoding/index.html#ReverseGeocoding
Also take a look at the GeoCoderPlus library referenced in this blog post
http://bricolsoftconsulting.com/perfect-geocoding-zoom-part-1/
It uses Google Maps Web APIs, but for ‘forward’ geocoding. You may be able to use the blog post and the included code as guidance to build your own implementation of reverse geocoding via the web.