title: Google Fit API : Get distance from google fit
body: <p>How do I calculate the distance covered by the user using the google fit API?
  Currently I am using google Fit History Api like this :</p>
  
  <pre><code>DataReadRequest readRequest = new DataReadRequest.Builder()
                    .aggregate(DataType.TYPE_DISTANCE_DELTA, DataType.AGGREGATE_DISTANCE_DELTA)
                    .bucketByTime(1, TimeUnit.DAYS)
                    .setTimeRange(startTime, endTime, TimeUnit.MILLISECONDS)
                    .build();
  
            DataReadResult dataReadResult =
                    Fitness.HistoryApi.readData(mGoogleApiClient, readRequest).await(1, TimeUnit.MINUTES);
  </code></pre>
  
  <p>But this is not returning any value 
  Does anyone a clue?</p>