如何在Android应用程序中使用Geocoder在特定位置找到大陆

Nar*_*mha 6 android widget reverse-geocoding

   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.
Run Code Online (Sandbox Code Playgroud)

例如:double lat = 17; double lon = 78.49;

List addresses = new Geocoder(Shout.this,Locale.getDefault()).getFromLocation(lat,lon,1);

我使用此代码输出的是印度,海德拉巴这个地址相关如何查找大陆,请帮我一些有价值的解决方案.

我正在使用地理编码器动态获取国家名称是他们有机会获得大陆名称以及country.it很难静态维护我需要动态任何免费服务找到基于大陆的服务

提前致谢

Sam*_*sen 2

我认为 Google 的 API 没有提供此类信息。我能想到的唯一解决方案是使用某种静态数据结构将国家/地区名称映射到大陆名称(您可能必须以某种方式找到自己,例如通过抓取网页...)。然后,您可以文本搜索 GeoCoder 为您提供的字符串,并返回与最接近匹配的国家/地区名称对应的大陆(这将是字符串映射中的键)。(您还必须处理美国地址的特殊情况,令人烦恼的是,它仅以州代码结尾)