How to use geocoder in android 2.2 emulator or Android 2.1 device

I need to use geocoder to get lang and lat from the address for google map.am working in android sdk 2.2.wen, using geocoder does not work, it throws an exception. How to use geocoder in my application. Or any other methods available to get long and lat?

I have an android 2.1 device. Are there any possibilities for gecoder to work in android 2.1, the actual deevice.I saw one stream on a web page in that they mentioned that the geocoder works fine in a real device 2.2. But I don’t know that it will work on device 2.1 or not I checked, but the geocoder does not work in the device either. No one helps me solve my problems.

Thank,

Lakshmanan

+3
source share
1 answer

The availability problem Geocoder has nothing to do with the platform version (2.1 or 2.2), and it all depends on whether the library that implements the service (for example, Google Maps) is available. (More details here - search "External library of maps")

Here is a page explaining how to install it in a development environment

Make sure that it would be useful for you to provide some kind of reserve in case the Google Maps library is not installed (for example, by requesting the Google Maps web API via HTTP when it detects that the geocoder is not implemented)

+1
source

Source: https://habr.com/ru/post/1771456/


All Articles