我的当前代码使用FusedLocationProviderApi获取用户的当前城市/地点。这段代码在我的Service中:
try {
Geocoder gcd = new Geocoder(LocationUpdateService.this, Locale.getDefault());
List<Address> addresses = gcd.getFromLocation(location.getLatitude(), location.getLongitude(), 1);
if (addresses.size() > 0)
{
txtStation.setText("Locality : " + addresses.get(0).getLocality() + " Sublocal : " + addresses.get(0).getSubLocality());
}
}catch (Exception e) {
Toast.makeText(LocationUpdateService.this, e.getMessage(), Toast.LENGTH_LONG).show();
}然而,我需要向用户展示,更具体的(公交车站,加油站等),我认为我必须使用Places API。
如何将Places API集成到我的当前代码(其中使用FusedLocationProviderApi)?
我现在想的是使用FusedLocationProviderApi获得基本的latitude & longitude,然后在这些坐标下使用Places API。
请帮我/给我一些线索。
非常感谢你的帮助
发布于 2015-11-18 12:16:23
https://stackoverflow.com/questions/33774895
复制相似问题