2016-08-29 213 views

回答

0

您可以在应用程序中使用模拟的位置,我不认为这将工作谷歌地图,因为它将无权使用模拟位置。您必须在清单中声明android.permission.ACCESS_MOCK_LOCATION。

获取使用

LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); 
     if (locationManager.isProviderEnabled(GPS_MOCK_PROVIDER)) { 
      locationManager.requestLocationUpdates(GPS_MOCK_PROVIDER, 0, 0f, this); 
     } 
位置