Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Inherited Constants](https://developer.android.com/reference/android/content/SyncStats#inhconstants) \| [Fields](https://developer.android.com/reference/android/content/SyncStats#lfields) \| [Ctors](https://developer.android.com/reference/android/content/SyncStats#pubctors) \| [Methods](https://developer.android.com/reference/android/content/SyncStats#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/content/SyncStats#inhmethods)

# SyncStats

*** ** * ** ***

` public class SyncStats `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/android/os/Parcelable `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.content.SyncStats |

<br />

*** ** * ** ***

Used to record various statistics about the result of a sync operation. The SyncManager gets access to these via a `https://developer.android.com/reference/android/content/SyncResult` and uses some of them to determine the disposition of the sync. See `https://developer.android.com/reference/android/content/SyncResult` for further dicussion on how the SyncManager uses these values.

## Summary

### Inherited constants

From interface `https://developer.android.com/reference/android/os/Parcelable` `int` `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR`

Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor.
`int` `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`

Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`".

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/content/SyncStats>` | `https://developer.android.com/reference/android/content/SyncStats#CREATOR` <br /> |
| ` public long` | `https://developer.android.com/reference/android/content/SyncStats#numAuthExceptions` The SyncAdapter was unable to authenticate the `https://developer.android.com/reference/android/accounts/Account` that was specified in the request. |
| ` public long` | `https://developer.android.com/reference/android/content/SyncStats#numConflictDetectedExceptions` The SyncAdapter detected that there was an unrecoverable version conflict when it attempted to update or delete a version of a resource on the server. |
| ` public long` | `https://developer.android.com/reference/android/content/SyncStats#numDeletes` Counter for tracking how many deletes were performed by the sync operation, as defined by the SyncAdapter. |
| ` public long` | `https://developer.android.com/reference/android/content/SyncStats#numEntries` Counter for tracking how many entries were affected by the sync operation, as defined by the SyncAdapter. |
| ` public long` | `https://developer.android.com/reference/android/content/SyncStats#numInserts` Counter for tracking how many inserts were performed by the sync operation, as defined by the SyncAdapter. |
| ` public long` | `https://developer.android.com/reference/android/content/SyncStats#numIoExceptions` The SyncAdapter had a problem, most likely with the network connectivity or a timeout while waiting for a network response. |
| ` public long` | `https://developer.android.com/reference/android/content/SyncStats#numParseExceptions` The SyncAdapter had a problem with the data it received from the server or the storage later. |
| ` public long` | `https://developer.android.com/reference/android/content/SyncStats#numSkippedEntries` Counter for tracking how many entries, either from the server or the local store, were ignored during the sync operation. |
| ` public long` | `https://developer.android.com/reference/android/content/SyncStats#numUpdates` Counter for tracking how many updates were performed by the sync operation, as defined by the SyncAdapter. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/content/SyncStats#SyncStats()() ` |
| ` https://developer.android.com/reference/android/content/SyncStats#SyncStats(android.os.Parcel)(https://developer.android.com/reference/android/os/Parcel in) ` |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/content/SyncStats#clear()() ` Reset all the counters to 0. |
| ` int` | ` https://developer.android.com/reference/android/content/SyncStats#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/SyncStats#toString()() ` Returns a string representation of the object. |
| ` void` | ` https://developer.android.com/reference/android/content/SyncStats#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.
From interface ` https://developer.android.com/reference/android/os/Parcelable ` ` abstract int` ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() `

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
` abstract void` ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) `

Flatten this object in to a Parcel.

## Fields

### CREATOR

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<SyncStats> CREATOR
```

<br />

<br />

### numAuthExceptions

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long numAuthExceptions
```

The SyncAdapter was unable to authenticate the `https://developer.android.com/reference/android/accounts/Account` that was specified in the request. The user needs to take some action to resolve before a future request can expect to succeed. This is considered a hard error.

<br />

### numConflictDetectedExceptions

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long numConflictDetectedExceptions
```

The SyncAdapter detected that there was an unrecoverable version conflict when it attempted to update or delete a version of a resource on the server. This is expected to clear itself automatically once the new state is retrieved from the server, though it may remain until the user intervenes manually, perhaps by clearing the local storage and starting over from scratch. This is considered a hard error.

<br />

### numDeletes

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long numDeletes
```

Counter for tracking how many deletes were performed by the sync operation, as defined by the SyncAdapter.

<br />

### numEntries

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long numEntries
```

Counter for tracking how many entries were affected by the sync operation, as defined by the SyncAdapter.

<br />

### numInserts

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long numInserts
```

Counter for tracking how many inserts were performed by the sync operation, as defined by the SyncAdapter.

<br />

### numIoExceptions

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long numIoExceptions
```

The SyncAdapter had a problem, most likely with the network connectivity or a timeout while waiting for a network response. The request may succeed if it is tried again later. This is considered a soft error.

<br />

### numParseExceptions

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long numParseExceptions
```

The SyncAdapter had a problem with the data it received from the server or the storage later. This problem will likely repeat if the request is tried again. The problem will need to be cleared up by either the server or the storage layer (likely with help from the user). If the SyncAdapter cleans up the data itself then it typically won't increment this value although it may still do so in order to record that it had to perform some cleanup. E.g., if the SyncAdapter received a bad entry from the server when processing a feed of entries, it may choose to drop the entry and thus make progress and still increment this value just so the SyncAdapter can record that an error occurred. This is considered a hard error.

<br />

### numSkippedEntries

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long numSkippedEntries
```

Counter for tracking how many entries, either from the server or the local store, were ignored during the sync operation. This could happen if the SyncAdapter detected some unparsable data but decided to skip it and move on rather than failing immediately.

<br />

### numUpdates

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public long numUpdates
```

Counter for tracking how many updates were performed by the sync operation, as defined by the SyncAdapter.

<br />

## Public constructors

### SyncStats

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public SyncStats ()
```

<br />

<br />

### SyncStats

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public SyncStats (Parcel in)
```

<br />

<br />

| Parameters ||
|---|---|
| `in` | `Parcel` <br /> |

## Public methods

### clear

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void clear ()
```

Reset all the counters to 0.

<br />

### describeContents

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int describeContents ()
```

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`, the return value of this method must include the `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### toString

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |

### writeToParcel

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `dest` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |