2

私のアプリケーションには、Google マップ ビューでユーザーに行き方を示すためのボタンがあります。

Google Now からユーザーの自宅/職場の場所を取得する方法はありますか?

4

1 に答える 1

-1

アプリケーションで Google Maps API を使用して、このような既存の方法で現在地を見つけることができます

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());

クレジット: https://stackoverflow.com/a/14493351/2071742

于 2013-02-28T10:52:22.070 に答える