DataUpdateRequest
Stay organized with collections
Save and categorize content based on your preferences.
A request to update data added by the app from the Google Fit store in the time interval
specified.
An app will provide time range using startTimeMillis and endTimeMillis for which app wants
to update the fitness data. Existing fitness data for the provided time range will be
cleared. In addition, app will provide DataSet
which will have new fitness data for the provided time range. This new data will be inserted
into fitness store.
An app can only update data that it has added and cannot update data added by other
apps.
Inherited Constant Summary
From interface android.os.Parcelable
int |
CONTENTS_FILE_DESCRIPTOR |
|
int |
PARCELABLE_WRITE_RETURN_VALUE |
|
Inherited Method Summary
From class java.lang.Object
Object
|
clone()
|
boolean |
|
void |
finalize()
|
final Class<?>
|
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String
|
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
From interface android.os.Parcelable
abstract int |
describeContents()
|
abstract void |
writeToParcel( Parcel arg0,
int arg1)
|
Public Methods
public boolean equals (Object o)
public DataSet
getDataSet ()
Returns the data set that you're inserting.
public long getEndTime (TimeUnit
timeUnit)
Returns the end time of the query, in the given unit since epoch. A valid end time
is always set.
public long getStartTime (TimeUnit
timeUnit)
Returns the start time of the query, in the given unit since epoch. A valid start
time is always set.
public void writeToParcel (Parcel dest, int
flags)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[null,null,["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eDataUpdateRequest\u003c/code\u003e allows apps to update fitness data within a specified time range, replacing existing data with a new \u003ccode\u003eDataSet\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe request specifies a start and end time for the data update, ensuring data is updated for the desired period.\u003c/p\u003e\n"],["\u003cp\u003eApps can only update data they have previously added to the Google Fit store, maintaining data ownership and privacy.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eDataUpdateRequest\u003c/code\u003e objects are built using a \u003ccode\u003eBuilder\u003c/code\u003e pattern and are \u003ccode\u003eParcelable\u003c/code\u003e for efficient data transfer.\u003c/p\u003e\n"]]],["`DataUpdateRequest` updates fitness data within a specified time range. Apps provide `startTimeMillis` and `endTimeMillis` to define the range. Existing data within this period is cleared, and a new `DataSet` replaces it. The `getDataSet()` method retrieves the new data. `getStartTime()` and `getEndTime()` return the range boundaries, and `writeToParcel()` is available for parceling the data. `equals()`, `hashCode()` and `toString()` provide object methods. Only app-added data can be updated.\n"],null,["# DataUpdateRequest\n\npublic class **DataUpdateRequest** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements [Parcelable](//developer.android.com/reference/android/os/Parcelable.html) \nA request to update data added by the app from the Google Fit store in the time interval\nspecified.\n\nAn app will provide time range using startTimeMillis and endTimeMillis for which app wants\nto update the fitness data. Existing fitness data for the provided time range will be\ncleared. In addition, app will provide [DataSet](/android/reference/com/google/android/gms/fitness/data/DataSet)\nwhich will have new fitness data for the provided time range. This new data will be inserted\ninto fitness store.\n\nAn app can only update data that it has added and cannot update data added by other\napps. \n\n### Nested Class Summary\n\n|-------|---|---|------------------------------------------------|\n| class | [DataUpdateRequest.Builder](/android/reference/com/google/android/gms/fitness/request/DataUpdateRequest.Builder) || Builder used to create new DataUpdateRequests. |\n\n### Inherited Constant Summary\n\nFrom interface android.os.Parcelable \n\n|-----|-------------------------------|---|\n| int | CONTENTS_FILE_DESCRIPTOR | |\n| int | PARCELABLE_WRITE_RETURN_VALUE | |\n\n### Field Summary\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------|---|\n| public static final [Creator](//developer.android.com/reference/android/os/Parcelable.Creator.html)\\\u003c[DataUpdateRequest](/android/reference/com/google/android/gms/fitness/request/DataUpdateRequest)\\\u003e | [CREATOR](/android/reference/com/google/android/gms/fitness/request/DataUpdateRequest#CREATOR) | |\n\n### Public Method Summary\n\n|---------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/android/reference/com/google/android/gms/fitness/request/DataUpdateRequest#equals(java.lang.Object))([Object](//developer.android.com/reference/java/lang/Object.html) o) |\n| [DataSet](/android/reference/com/google/android/gms/fitness/data/DataSet) | [getDataSet](/android/reference/com/google/android/gms/fitness/request/DataUpdateRequest#getDataSet())() Returns the data set that you're inserting. |\n| long | [getEndTime](/android/reference/com/google/android/gms/fitness/request/DataUpdateRequest#getEndTime(java.util.concurrent.TimeUnit))([TimeUnit](//developer.android.com/reference/java/util/concurrent/TimeUnit.html) timeUnit) Returns the end time of the query, in the given unit since epoch. |\n| long | [getStartTime](/android/reference/com/google/android/gms/fitness/request/DataUpdateRequest#getStartTime(java.util.concurrent.TimeUnit))([TimeUnit](//developer.android.com/reference/java/util/concurrent/TimeUnit.html) timeUnit) Returns the start time of the query, in the given unit since epoch. |\n| int | [hashCode](/android/reference/com/google/android/gms/fitness/request/DataUpdateRequest#hashCode())() |\n| [String](//developer.android.com/reference/java/lang/String.html) | [toString](/android/reference/com/google/android/gms/fitness/request/DataUpdateRequest#toString())() |\n| void | [writeToParcel](/android/reference/com/google/android/gms/fitness/request/DataUpdateRequest#writeToParcel(android.os.Parcel,%20int))([Parcel](//developer.android.com/reference/android/os/Parcel.html) dest, int flags) |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nFrom interface android.os.Parcelable \n\n|---------------|--------------------------------------------------------------------------------------------------|\n| abstract int | describeContents() |\n| abstract void | writeToParcel([Parcel](//developer.android.com/reference/android/os/Parcel.html) arg0, int arg1) |\n\nFields\n------\n\n#### public static final [Creator](//developer.android.com/reference/android/os/Parcelable.Creator.html)\\\u003c[DataUpdateRequest](/android/reference/com/google/android/gms/fitness/request/DataUpdateRequest)\\\u003e\n**CREATOR**\n\nPublic Methods\n--------------\n\n#### public boolean **equals** ([Object](//developer.android.com/reference/java/lang/Object.html) o)\n\n#### public [DataSet](/android/reference/com/google/android/gms/fitness/data/DataSet)\n**getDataSet** ()\n\nReturns the data set that you're inserting. \n\n#### public long **getEndTime** ([TimeUnit](//developer.android.com/reference/java/util/concurrent/TimeUnit.html) timeUnit)\n\nReturns the end time of the query, in the given unit since epoch. A valid end time\nis always set. \n\n#### public long **getStartTime** ([TimeUnit](//developer.android.com/reference/java/util/concurrent/TimeUnit.html) timeUnit)\n\nReturns the start time of the query, in the given unit since epoch. A valid start\ntime is always set. \n\n#### public int **hashCode** ()\n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **toString** ()\n\n#### public void **writeToParcel** ([Parcel](//developer.android.com/reference/android/os/Parcel.html) dest, int flags)"]]