GPS Updates

I have a strange requirement. The app I'm working on is suppose to receive a notification, and based on that notification it either stops GPS tracking, or starts it. If it does start it, it has to be done at a preset interval (like every 30 seconds for example). What is the best way to do that? I've implemented a basic GCM Listener.

I've tried following some basics by making my own LocationService, and the notification part either starts or stops the service. However, the LocationService causes a crash.

The basis of the service is form here: https://github.com/xamarin/monodroid-samples/blob/master/google-services/Location/LocationUpdates/LocationUpdates/MainActivity.cs#L110

It seems to crash at this line:

protected async System.Threading.Tasks.Task StartLocationUpdates()
{
await LocationServices.FusedLocationApi.RequestLocationUpdates(mGoogleApiClient, mLocationRequest, this);
}

Sign In or Register to comment.