public static SensorConfig getDefault() {
   SensorConfig sensorConfig = new SensorConfig();
   sensorConfig.setParameter(FORCE_ENABLE_SENSOR, DEFAULT_FORCE_ENABLE);
   sensorConfig.setParameter(
       PullSensorConfig.POST_SENSE_SLEEP_LENGTH_MILLIS, DEFAULT_SLEEP_INTERVAL);
   sensorConfig.setParameter(PullSensorConfig.NUMBER_OF_SENSE_CYCLES, DEFAULT_SAMPLING_CYCLES);
   sensorConfig.setParameter(
       PullSensorConfig.SENSE_WINDOW_LENGTH_PER_CYCLE_MILLIS,
       DEFAULT_SAMPLING_WINDOW_SIZE_PER_CYCLE_MILLIS);
   return sensorConfig;
 }
  protected SensorConfig getGenericConfig(JSONObject json) {
    SensorConfig config = new SensorConfig();
    try {
      Long sleepLength = (Long) json.get(SLEEP_LENGTH);
      config.setParameter(SLEEP_LENGTH, sleepLength);

      Boolean isAdaptivelySensed = (Boolean) json.get(IS_ADAPTIVELY_SENSED);
      config.setParameter(PullSensorConfig.ADAPTIVE_SENSING_ENABLED, isAdaptivelySensed);
    } catch (Exception e) {
    }
    return config;
  }