GymRatTrax / GymRatTrax-FitnessScheduler

GymRatTrax - Personal Fitness Scheduler
http://gymrattrax.com/
4 stars 1 forks source link

Distance delta not able to insert in HISTORY_API #75

Open Sutirth opened 8 years ago

Sutirth commented 8 years ago

DataSource dataSourceDistance = new DataSource.Builder() .setAppPackageName(this) .setDataType(DataType.TYPE_DISTANCE_DELTA) .setName(TAG + " - distance") .setType(DataSource.TYPE_DERIVED) .build();

    // Create a data set
    DataSet dataSetDistance = DataSet.create(dataSourceDistance);
    // For each data point, specify a start time, end time, and the data value -- in this case,
    // the number of new steps.
    DataPoint dataPointDistance = dataSetDistance.createDataPoint()
            .setTimeInterval(startTime, endTime, TimeUnit.MILLISECONDS);
    dataPointDistance.getValue(Field.FIELD_DISTANCE).setFloat(distanceInMeters);
    dataSetDistance.add(dataPointDistance);

I get error as There was a problem inserting the dataset.