In my application, I am doing like this and its working fine for me, // Geocoding Geocoder geoCoder = new Geocoder(getBaseContext(), Locale .getDefault()); try { List<Address> addresses = geoCoder .getFromLocation(p.getLatitudeE6() / 1E6, p .getLongitudeE6() / 1E6, 1);
String add = ""; if (addresses.size() > 0) { for (int i = 0; i < addresses.get(0) .getMaxAddressLineIndex(); i++) add += addresses.get(0).getAddressLine(i) + "\n"; } } And the permissions I gave are, <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> check this, http://code.google.com/p/locationfinder/downloads/list but this is for SDK 1.1... Anyway, you can have a look at it. Nithin On Jan 7, 6:22 pm, sathya subbiah <sathya.subbia...@gmail.com> wrote: > Hi Nithin, > > Thanks for the reply. The Lat. and Long. values are not 0. I am checking > with values like > 37.422006 - Lat > -122.084095 - Long > > But still the address read is 0. Can you pls let me know if some thing else > is to be set. I am also providing permission like > > <uses-permission android:name="android.permission.INTERNET"/> > <uses-permission > android:name="android.permission.ACCESS_FINE_LOCATION"/> > <uses-permission > android:name="android.permission.ACCESS_COARSE_LOCATION"/> > <uses-permission > android:name="android.permission.ACCESS_MOCK_LOCATION"/> > > But still it is not able to decode the address. > > Rgs, > Sathya > > On Thu, Jan 7, 2010 at 8:01 AM, Nithin <nithin.war...@gmail.com> wrote: > > > Check the latitude and longitude value, that you are passing to > > getFromLocation(). Then try, giving the number of results a bigger > > value than 1. > > > Nithin > > > On Jan 7, 3:58 pm, sathya subbiah <sathya.subbia...@gmail.com> wrote: > > > Hi, > > > > I am trying to get address from Longitude and latitude using the > > following > > > code > > > > Geocoder geoCoder = new > > > Geocoder(mContext,Locale.getDefault()); > > > > List<Address> addresses = geoCoder.getFromLocation( > > > mCurrentLatitude, > > > mCurrentLongitude, 1); > > > > But the address size is always 0. I am trying this in Android SDK 2.0 > > using > > > eclipse. Can anyone help me to resolve the issue?. > > > > Thanks & Regards, > > > Sathya > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to android-developers@googlegroups.com > > To unsubscribe from this group, send email to > > android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com> > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en
-- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en