i am tried up with some common set of codes, to get convert the lat long values into address. But i am unable to get that in all the time.. which would be the best option for this. I need this service should be constant. because i need to deliver this to a client.
suggest me a good solution? Should i have to buy a service from google or yahoo? Those peoples are providing separate service for this. My main question is should this "geocoder" will be ok or not??
My code is
void getAddress(){
try{
Geocoder gcd = new Geocoder(this, Locale.getDefault());
List<Address> addresses = gcd.getFromLocation(latitude, longitude,100);
Log.d("latlong value",latitude +"---"+longitude);
if (addresses.size() > 0)
{
StringBuilder result = new StringBuilder();
result.append(addresses.get(0).getCountryName());
country=result.toString();
}
}
catch(IOException ex){
}
}