Esempio n. 1
0
        public void OnLocationChanged(Location location)
        {
            _currentLocation = location;
            if (_currentLocation == null)
            {
                return;
            }

            var trackState = TrackStateFactory.CreateTrackState(DateTime.Now, 0, 0, 0, 0, 0, 0, _currentLocation.Latitude,
                                                                _currentLocation.Longitude, _currentLocation.Speed, _currentLocation.Provider, _currentLocation.Accuracy);

            TrackStateFactory.AddTrackState(trackState);

            // Log.Info(TAG, $"Lat:{_currentLocation.Latitude}, Long:{_currentLocation.Longitude}, Spd:{_currentLocation.Speed}");
        }
Esempio n. 2
0
        public void OnSensorChanged(SensorEvent e)
        {
            if (e.Sensor.Type == SensorType.Accelerometer)
            {
                var trackState = TrackStateFactory.CreateTrackState(DateTime.Now, e.Values[0], e.Values[1], e.Values[2]);
                TrackStateFactory.AddTrackState(trackState);
            }

            if (e.Sensor.Type == SensorType.Gravity)
            {
                var trackState = TrackStateFactory.CreateTrackState(DateTime.Now, 0, 0, 0, e.Values[0], e.Values[1], e.Values[2]);
                TrackStateFactory.AddTrackState(trackState);
            }

            // Log.Info(TAG, $"X:{e.Values[0]}, Y:{e.Values[1]}, Z:{e.Values[2]}");
        }