i am developing android application using Geocoder services,
I have an application where I try to get address of a location based on
the latitude,longitude coordinates its working fine.
my problem is how to get continent of particular address.
example : double lat=17; double lon=78.49;
List addresses = new Geocoder(Shout.this,Locale.getDefault()).getFromLocation(lat, lon, 1);
i am using this code output is India,Hyderabad this address related how to find continent ,please help me some valuable solution.
i am getting country name dynamically using geocoder is their any chance to get in continent name along with country.it is difficult to maintain statically i need dynamically any free services find continent based services
Thanks In Advance
I don't think there is such information given by Google's API. The only solution I can think of is to have some kind of static data structure mapping country names to continent names (which you would presumably have to find yourself somehow, for instance by scraping this web page... ). Then you could text search the string that GeoCoder gives you and return the continent corresponding to the closest matching country name (which would be the key in your String mapping). (You would also have to treat the special case of US addresses which, annoyingly, end just with the state code)
这篇关于如何在 Android 应用程序中使用 Geocoder 在特定位置查找大陆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!