com.samsung.android.sdk.healthdata

Class HealthDataResolver.DeleteRequest.Builder

  • java.lang.Object
    • com.samsung.android.sdk.healthdata.HealthDataResolver.DeleteRequest.Builder
  • Enclosing interface:
    HealthDataResolver.DeleteRequest


    public static class HealthDataResolver.DeleteRequest.Builder
    extends Object
    This class is a builder to configure HealthDataResolver.DeleteRequest. Only your app's created health data can be deleted.

       public class HealthDataResolverExample {
           private HealthDataResolver.DeleteRequest buildDeleteRequest() {
      
               HealthDataResolver.Filter filter = HealthDataResolver.Filter.lessThan(HealthConstants.Nutrition.Calories, 10);
      
               HealthDataResolver.DeleteRequest request = new HealthDataResolver.DeleteRequest.Builder()
                   .setDataType(HealthConstants.Nutrition.HEALTH_DATA_TYPE)
                   .setFilter(filter)
                   .build();
      
               return request;
           }
       }

    Since:
    1.0.0
    • Method Detail

      • setSourceDevices

        public HealthDataResolver.DeleteRequest.Builder setSourceDevices(List<String> uuidList)
        Sets a UUID list of source devices for health data to be deleted.
        Parameters:
        uuidList - The UUID list for source devices
        Returns:
        The object that applies source devices
        Since:
        1.0.0
      • setLocalTimeRange

        public HealthDataResolver.DeleteRequest.Builder setLocalTimeRange(String timeProperty,
                                                                          String offsetProperty,
                                                                          long begin,
                                                                          long end)
        Sets the local time range not to miss data from the query's result when there exist data with a different TIME_OFFSET in the saved health data.

        The data that has a different TIME_OFFSET with other data's TIME_OFFSET can be saved when the daylight time is applied or the user moves to another region by like a travel. Building a complete query to aggregate all data including the different TIME_OFFSET is not easy.
        Use this API to build an aggregate request as possible.

        Parameters:
        timeProperty - The time property name that needs to add a filter
        offsetProperty - The time offset property
        begin - The beginning time with GMT+0 milliseconds.
        E.g. If you would like to delete data from 00:00:00 on October 26th, 2021 in your region, set the value with 1635206400000.
        See sample codes.
        Its minimum value is Long.MIN_VALUE.
        end - The end time with GMT+0 milliseconds.
        E.g. If you would like to delete data until 00:00:00 on October 26th, 2021 in your region, set the value with 1635206400000.
        See sample codes.
        Its maximum value is Long.MAX_VALUE.
        Returns:
        The object that applies the local time range
        Since:
        1.5.0