2

在我的应用程序中,我有一个按钮,用于在 Google 地图视图上向用户显示他要走的路。

有没有办法从 Google Now 获取用户的家庭/工作位置?

4

1 回答 1

-1

You can use Google Maps API in your application and find out your location through existing methods like this

LocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE);
Criteria criteria = new Criteria();
String provider = service.getBestProvider(criteria, false);
Location location = service.getLastKnownLocation(provider);
LatLng userLocation = new LatLng(location.getLatitude(),location.getLongitude());

credits : https://stackoverflow.com/a/14493351/2071742

于 2013-02-28T10:52:22.070 回答