/// <summary>
        /// An event handler to handle GPS track changed event.
        /// </summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="statusUpdate">The event argument with detailed data.</param>
        private async void LocationTracker_OnTrackingProgressChangedEvent(object sender, LocationResponseEventArgs statusUpdate)
        {
            // This mechanism is purely managed by OS, there are lots of time the app could not get any update for long time.
            var eventProperties = new Dictionary <string, string>()
            {
                { "Coordinate null", (statusUpdate.Coordinate == null).ToString() },
                { "Tracking id", this.trackingId }
            };

            HockeyClient.Current.TrackEvent("Location changed", eventProperties, null);
            await this.DisplayMostRecentLocationData(statusUpdate.Coordinate);

            await this.gpxHandler.RecordLocationAsync(this.trackingId, statusUpdate.Coordinate, "source E");

            this.mostRecentLocationUpdateTime = DateTime.Now;
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GpsLocationTracker"/> class.
 /// </summary>
 public GpsLocationTracker()
 {
     this.statusUpdate = new LocationResponseEventArgs();
 }