2016-08-29 215 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); 
     } 
位置