public PhoneSensorActivity GetSensorActivityPhone() { if (current == null) { current = new PhoneSensorActivity(); } current.XAccelerationValue = Instance.XAccelerationValue; current.YAccelerationValue = Instance.YAccelerationValue; current.ZAccelerationValue = Instance.ZAccelerationValue; current.AccelerationAverage = Instance.AccelerationAverage; current.XMagnetometerValue = Instance.XMagnetometerValue; current.YMagnetometerValue = Instance.YMagnetometerValue; current.ZMagnetometerValue = Instance.ZMagnetometerValue; current.MagnetometerAverage = Instance.MagnetometerAverage; current.XGyroscopeValue = Instance.XGyroscopeValue; current.YGyroscopeValue = Instance.YGyroscopeValue; current.ZGyroscopeValue = Instance.ZGyroscopeValue; current.GyroscopeAverage = Instance.GyroscopeAverage; current.XOrientationValue = Instance.XOrientationValue; current.YOrientationValue = Instance.YOrientationValue; current.ZOrientationValue = Instance.ZOrientationValue; current.WOrientationValue = Instance.WOrientationValue; current.TimeStamp = DateTime.Now.ToString(Constants.DATETIMEFORMAT); current.GPSTime = Instance.GPSTime; current.Latitude = Instance.Latitude; current.Longitude = Instance.Longitude; current.Altitude = Instance.Altitude; current.GPSAccuracy = Instance.GPSAccuracy; return(current); }
public void StopSensors() { Accelerometer.Stop(); Magnetometer.Stop(); Gyroscope.Stop(); Accelerometer.ReadingChanged -= Accelerometer_ReadingChanged; Magnetometer.ReadingChanged -= Magnetometer_ReadingChanged; Gyroscope.ReadingChanged -= Gyrotometer_ReadingChanged; OrientationSensor.ReadingChanged -= OrientationSensor_ReadingChanged; _instance = null; }