I've been working with the LocationClient
and have setup a Geofence
, but don't know how to test it.
The issue comes from the fact that you can't run the app in an emulator, because LocationClient
uses GooglePlayServices
which are unavailable in an emulator. You also can't use MockLocations
as far as I know, because you use MockLocations
by creating a Provider, and LocationClient
doesn't let you set a Provider.
So... how am I supposed to test my Geofence
? (Besides getting in the car...).
Most phones have a debug setting to enable mocking the location.
For example on my Samsung S3 it's under
Settings->Developer options->Allow mock locations
After turning this on you need an app from the play store that sets the location.
As an example https://play.google.com/store/apps/details?id=com.lexa.fakegps&hl=en
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With