Example #1
0
 public void SetTrackingEnabled(bool enabled, TrackingDelay desiredDelay = TrackingDelay.Long)
 {
     this.desiredDelay = desiredDelay;
     if (!enabled)
     {
         StopCurrentLocationTracking();
     }
     if (currentRequest != ConnectionUpdateRequest.None)
     {
         return;
     }
     currentRequest = enabled ? ConnectionUpdateRequest.Start : ConnectionUpdateRequest.Stop;
     if (client == null)
     {
         client = CreateGoogleClient();
     }
     if (!(client.IsConnected || client.IsConnecting))
     {
         client.Connect();
     }
 }
 public void SetTrackingEnabled(bool enabled, TrackingDelay desiredDelay = TrackingDelay.Long)
 {
     this.desiredDelay = desiredDelay;
     if (!enabled)
         StopCurrentLocationTracking ();
     if (currentRequest != ConnectionUpdateRequest.None)
         return;
     currentRequest = enabled ? ConnectionUpdateRequest.Start : ConnectionUpdateRequest.Stop;
     if (client == null)
         client = new ActivityRecognitionClient (context, this, this);
     if (!(client.IsConnected || client.IsConnecting))
         client.Connect ();
 }