質問

Is it possible to get applications such as FakeGPS to work with the new fused location provider (Google Play Services)?

I believe this is the issue:

09-20 17:18:41.842  21753-21809/? W/LocationManager﹕ java.lang.IllegalArgumentException: Incomplete location object, missing timestamp or accuracy? Location[gps 32.899542,-100.165065 acc=1 et=?!? alt=65.0]
        at android.location.LocationManager.setTestProviderLocation(LocationManager.java:1218)
        at com.lexa.fakegps.FakeGPSProvider.run(FakeGPSProvider.java:75)
役に立ちましたか?

解決

The Fused Location Provider can only use mock locations provided by setMockMode() and setMockLocation(). Calling android.location.LocationManager.setTestProviderLocation() has no effect on the locations generated by Fused Location Provider.

Although FakeGPS won't do anything for Fused Location Provider, the new Android training lesson for Mock Locations: Testing Using Mock Locations includes a sample app that injects mock locations into Fused Location Provider.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top