title: How to know steps is recorded by sensors or input by user from google fit programmatically
body: <p>I get steps for google fit from this Code </p>
  
  <pre><code>PendingResult&lt;DataReadResult&gt; pendingResult = Fitness.HistoryApi
              .readData(
                      fitnessClient,
                      new DataReadRequest.Builder()
                              .aggregate(DataType.TYPE_STEP_COUNT_DELTA,
                                      DataType.AGGREGATE_STEP_COUNT_DELTA)
                              .bucketByTime(1, TimeUnit.DAYS)
                              .setTimeRange(startTime, endTime,
                                      TimeUnit.MILLISECONDS).build());
      int steps = 0;
      DataReadResult dataReadResult = pendingResult.await();
      if (dataReadResult.getBuckets().size() &gt; 0) {
          //Log.e("TAG", "Number of returned buckets of DataSets is: "
                  //+ dataReadResult.getBuckets().size());
          for (Bucket bucket : dataReadResult.getBuckets()) {
              List&lt;DataSet&gt; dataSets = bucket.getDataSets();
              for (DataSet dataSet : dataSets) {
                  for (DataPoint dp : dataSet.getDataPoints()) {
                      for (Field field : dp.getDataType().getFields()) {
                          steps += dp.getValue(field).asInt();
                      }
                  }
              }
          }
      } else if (dataReadResult.getDataSets().size() &gt; 0) {
          for (DataSet dataSet : dataReadResult.getDataSets()) {
              for (DataPoint dp : dataSet.getDataPoints()) {
                  for (Field field : dp.getDataType().getFields()) {
                      steps += dp.getValue(field).asInt();
                  }
              }
          }
      }
      return steps;
  </code></pre>
  
  <p>Now I have a setting option in my app by that user can turn off the steps sensing by the health kit. How to achieve this functionality?</p>