# MtpObjectInfo

Added in[API level 12](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Nested Classes](https://developer.android.com/reference/android/mtp/MtpObjectInfo#nestedclasses)\|[Methods](https://developer.android.com/reference/android/mtp/MtpObjectInfo#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/mtp/MtpObjectInfo#inhmethods)  

# MtpObjectInfo

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/mtp/MtpObjectInfo "View this page in Kotlin")\|Java

`
public

final

class
MtpObjectInfo
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

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

<br />

*** ** * ** ***

This class encapsulates information about an object on an MTP device. This corresponds to the ObjectInfo Dataset described in section 5.3.1 of the MTP specification.

## Summary

|                                                               ### Nested classes                                                                ||
|----------|---------------------------------------------------------------------------------------------------------------------------------------|
| ` class` | [MtpObjectInfo.Builder](https://developer.android.com/reference/android/mtp/MtpObjectInfo.Builder) Builds a new object info instance. |

|                                                                                                                                                                                                                                                                                                                                                    ### Public methods                                                                                                                                                                                                                                                                                                                                                     ||
|-----------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` int`                                                                | ` `[getAssociationDesc](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getAssociationDesc())`() ` Returns the association description for the MTP object Will be zero objects that are not of format[MtpConstants.FORMAT_ASSOCIATION](https://developer.android.com/reference/android/mtp/MtpConstants#FORMAT_ASSOCIATION)                                                                                                                                                                                                                                                                                                      |
| ` int`                                                                | ` `[getAssociationType](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getAssociationType())`() ` Returns the association type for the MTP object Will be zero objects that are not of format[MtpConstants.FORMAT_ASSOCIATION](https://developer.android.com/reference/android/mtp/MtpConstants#FORMAT_ASSOCIATION)For directories the association type is typically[MtpConstants.ASSOCIATION_TYPE_GENERIC_FOLDER](https://developer.android.com/reference/android/mtp/MtpConstants#ASSOCIATION_TYPE_GENERIC_FOLDER)                                                                                                            |
| ` int`                                                                | ` `[getCompressedSize](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getCompressedSize())`() ` Returns the size of the MTP object                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` long`                                                               | ` `[getCompressedSizeLong](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getCompressedSizeLong())`() ` Returns the size of the MTP object                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` long`                                                               | ` `[getDateCreated](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getDateCreated())`() ` Returns the creation date of the MTP object The value is represented as milliseconds since January 1, 1970                                                                                                                                                                                                                                                                                                                                                                                                                            |
| ` long`                                                               | ` `[getDateModified](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getDateModified())`() ` Returns the modification date of the MTP object The value is represented as milliseconds since January 1, 1970                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` int`                                                                | ` `[getFormat](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getFormat())`() ` Returns the format code for the MTP object                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` int`                                                                | ` `[getImagePixDepth](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getImagePixDepth())`() ` Returns the depth of the MTP object in bits per pixel Will be zero for non-image objects                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` long`                                                               | ` `[getImagePixDepthLong](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getImagePixDepthLong())`() ` Returns the depth of the MTP object in bits per pixel Will be zero for non-image objects                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` int`                                                                | ` `[getImagePixHeight](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getImagePixHeight())`() ` Returns the height of the MTP object in pixels Will be zero for non-image objects                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` long`                                                               | ` `[getImagePixHeightLong](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getImagePixHeightLong())`() ` Returns the height of the MTP object in pixels Will be zero for non-image objects                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ` int`                                                                | ` `[getImagePixWidth](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getImagePixWidth())`() ` Returns the width of the MTP object in pixels Will be zero for non-image objects                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` long`                                                               | ` `[getImagePixWidthLong](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getImagePixWidthLong())`() ` Returns the width of the MTP object in pixels Will be zero for non-image objects                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ` `[String](https://developer.android.com/reference/java/lang/String) | ` `[getKeywords](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getKeywords())`() ` Returns a comma separated list of keywords for the MTP object                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` `[String](https://developer.android.com/reference/java/lang/String) | ` `[getName](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getName())`() ` Returns the name of the MTP object                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` int`                                                                | ` `[getObjectHandle](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getObjectHandle())`() ` Returns the object handle for the MTP object                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ` int`                                                                | ` `[getParent](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getParent())`() ` Returns the object handle for the object's parent Will be zero for the root directory of a storage unit                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` int`                                                                | ` `[getProtectionStatus](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getProtectionStatus())`() ` Returns the protection status for the MTP object Possible values are: - [MtpConstants.PROTECTION_STATUS_NONE](https://developer.android.com/reference/android/mtp/MtpConstants#PROTECTION_STATUS_NONE) - [MtpConstants.PROTECTION_STATUS_READ_ONLY](https://developer.android.com/reference/android/mtp/MtpConstants#PROTECTION_STATUS_READ_ONLY) - [MtpConstants.PROTECTION_STATUS_NON_TRANSFERABLE_DATA](https://developer.android.com/reference/android/mtp/MtpConstants#PROTECTION_STATUS_NON_TRANSFERABLE_DATA) <br /> |
| ` int`                                                                | ` `[getSequenceNumber](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getSequenceNumber())`() ` Returns the sequence number for the MTP object This field is typically not used for MTP devices, but is sometimes used to define a sequence of photos on PTP cameras.                                                                                                                                                                                                                                                                                                                                                           |
| ` long`                                                               | ` `[getSequenceNumberLong](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getSequenceNumberLong())`() ` Returns the sequence number for the MTP object This field is typically not used for MTP devices, but is sometimes used to define a sequence of photos on PTP cameras.                                                                                                                                                                                                                                                                                                                                                   |
| ` int`                                                                | ` `[getStorageId](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getStorageId())`() ` Returns the storage ID for the MTP object's storage unit                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` int`                                                                | ` `[getThumbCompressedSize](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getThumbCompressedSize())`() ` Returns the size of the MTP object's thumbnail Will be zero for objects with no thumbnail                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ` long`                                                               | ` `[getThumbCompressedSizeLong](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getThumbCompressedSizeLong())`() ` Returns the size of the MTP object's thumbnail Will be zero for objects with no thumbnail                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` int`                                                                | ` `[getThumbFormat](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getThumbFormat())`() ` Returns the format code for the MTP object's thumbnail Will be zero for objects with no thumbnail                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` int`                                                                | ` `[getThumbPixHeight](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getThumbPixHeight())`() ` Returns the height of the MTP object's thumbnail in pixels Will be zero for objects with no thumbnail                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` long`                                                               | ` `[getThumbPixHeightLong](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getThumbPixHeightLong())`() ` Returns the height of the MTP object's thumbnail in pixels Will be zero for objects with no thumbnail                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ` int`                                                                | ` `[getThumbPixWidth](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getThumbPixWidth())`() ` Returns the width of the MTP object's thumbnail in pixels Will be zero for objects with no thumbnail                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ` long`                                                               | ` `[getThumbPixWidthLong](https://developer.android.com/reference/android/mtp/MtpObjectInfo#getThumbPixWidthLong())`() ` Returns the width of the MTP object's thumbnail in pixels Will be zero for objects with no thumbnail                                                                                                                                                                                                                                                                                                                                                                                                                      |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](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 `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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*.                                                                                             | ||

## Public methods

### getAssociationDesc

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

```
public int getAssociationDesc ()
```

Returns the association description for the MTP object Will be zero objects that are not of format[MtpConstants.FORMAT_ASSOCIATION](https://developer.android.com/reference/android/mtp/MtpConstants#FORMAT_ASSOCIATION)

<br />

|                      Returns                       ||
|-------|---------------------------------------------|
| `int` | the object's association description <br /> |

### getAssociationType

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

```
public int getAssociationType ()
```

Returns the association type for the MTP object Will be zero objects that are not of format[MtpConstants.FORMAT_ASSOCIATION](https://developer.android.com/reference/android/mtp/MtpConstants#FORMAT_ASSOCIATION)For directories the association type is typically[MtpConstants.ASSOCIATION_TYPE_GENERIC_FOLDER](https://developer.android.com/reference/android/mtp/MtpConstants#ASSOCIATION_TYPE_GENERIC_FOLDER)

<br />

|                   Returns                   ||
|-------|--------------------------------------|
| `int` | the object's association type <br /> |

### getCompressedSize

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

```
public int getCompressedSize ()
```

Returns the size of the MTP object

<br />

|            Returns            ||
|-------|------------------------|
| `int` | the object size <br /> |

### getCompressedSizeLong

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

```
public long getCompressedSizeLong ()
```

Returns the size of the MTP object

<br />

|            Returns             ||
|--------|------------------------|
| `long` | the object size <br /> |

### getDateCreated

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

```
public long getDateCreated ()
```

Returns the creation date of the MTP object The value is represented as milliseconds since January 1, 1970

<br />

|                  Returns                  ||
|--------|-----------------------------------|
| `long` | the object's creation date <br /> |

### getDateModified

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

```
public long getDateModified ()
```

Returns the modification date of the MTP object The value is represented as milliseconds since January 1, 1970

<br />

|                    Returns                    ||
|--------|---------------------------------------|
| `long` | the object's modification date <br /> |

### getFormat

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

```
public int getFormat ()
```

Returns the format code for the MTP object

<br />

|            Returns            ||
|-------|------------------------|
| `int` | the format code <br /> |

### getImagePixDepth

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

```
public int getImagePixDepth ()
```

Returns the depth of the MTP object in bits per pixel Will be zero for non-image objects

<br />

|            Returns            ||
|-------|------------------------|
| `int` | the image depth <br /> |

### getImagePixDepthLong

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

```
public long getImagePixDepthLong ()
```

Returns the depth of the MTP object in bits per pixel Will be zero for non-image objects

<br />

|            Returns             ||
|--------|------------------------|
| `long` | the image depth <br /> |

### getImagePixHeight

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

```
public int getImagePixHeight ()
```

Returns the height of the MTP object in pixels Will be zero for non-image objects

<br />

|            Returns             ||
|-------|-------------------------|
| `int` | the image height <br /> |

### getImagePixHeightLong

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

```
public long getImagePixHeightLong ()
```

Returns the height of the MTP object in pixels Will be zero for non-image objects

<br />

|             Returns             ||
|--------|-------------------------|
| `long` | the image height <br /> |

### getImagePixWidth

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

```
public int getImagePixWidth ()
```

Returns the width of the MTP object in pixels Will be zero for non-image objects

<br />

|            Returns            ||
|-------|------------------------|
| `int` | the image width <br /> |

### getImagePixWidthLong

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

```
public long getImagePixWidthLong ()
```

Returns the width of the MTP object in pixels Will be zero for non-image objects

<br />

|            Returns             ||
|--------|------------------------|
| `long` | the image width <br /> |

### getKeywords

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

```
public String getKeywords ()
```

Returns a comma separated list of keywords for the MTP object

<br />

|                                                             Returns                                                              ||
|--------------------------------------------------------------------|--------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | the object's keyword list This value cannot be`null`. <br /> |

### getName

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

```
public String getName ()
```

Returns the name of the MTP object

<br />

|                                                         Returns                                                          ||
|--------------------------------------------------------------------|------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | the object's name This value cannot be`null`. <br /> |

### getObjectHandle

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

```
public int getObjectHandle ()
```

Returns the object handle for the MTP object

<br />

|             Returns             ||
|-------|--------------------------|
| `int` | the object handle <br /> |

### getParent

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

```
public int getParent ()
```

Returns the object handle for the object's parent Will be zero for the root directory of a storage unit

<br />

|              Returns              ||
|-------|----------------------------|
| `int` | the object's parent <br /> |

### getProtectionStatus

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

```
public int getProtectionStatus ()
```

Returns the protection status for the MTP object Possible values are:

- [MtpConstants.PROTECTION_STATUS_NONE](https://developer.android.com/reference/android/mtp/MtpConstants#PROTECTION_STATUS_NONE)
- [MtpConstants.PROTECTION_STATUS_READ_ONLY](https://developer.android.com/reference/android/mtp/MtpConstants#PROTECTION_STATUS_READ_ONLY)
- [MtpConstants.PROTECTION_STATUS_NON_TRANSFERABLE_DATA](https://developer.android.com/reference/android/mtp/MtpConstants#PROTECTION_STATUS_NON_TRANSFERABLE_DATA)

<br />

<br />

|               Returns               ||
|-------|------------------------------|
| `int` | the protection status <br /> |

### getSequenceNumber

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

```
public int getSequenceNumber ()
```

Returns the sequence number for the MTP object This field is typically not used for MTP devices, but is sometimes used to define a sequence of photos on PTP cameras.

<br />

|                  Returns                   ||
|-------|-------------------------------------|
| `int` | the object's sequence number <br /> |

### getSequenceNumberLong

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

```
public long getSequenceNumberLong ()
```

Returns the sequence number for the MTP object This field is typically not used for MTP devices, but is sometimes used to define a sequence of photos on PTP cameras.

<br />

|                   Returns                   ||
|--------|-------------------------------------|
| `long` | the object's sequence number <br /> |

### getStorageId

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

```
public int getStorageId ()
```

Returns the storage ID for the MTP object's storage unit

<br />

|           Returns            ||
|-------|-----------------------|
| `int` | the storage ID <br /> |

### getThumbCompressedSize

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

```
public int getThumbCompressedSize ()
```

Returns the size of the MTP object's thumbnail Will be zero for objects with no thumbnail

<br />

|             Returns              ||
|-------|---------------------------|
| `int` | the thumbnail size <br /> |

### getThumbCompressedSizeLong

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

```
public long getThumbCompressedSizeLong ()
```

Returns the size of the MTP object's thumbnail Will be zero for objects with no thumbnail

<br />

|              Returns              ||
|--------|---------------------------|
| `long` | the thumbnail size <br /> |

### getThumbFormat

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

```
public int getThumbFormat ()
```

Returns the format code for the MTP object's thumbnail Will be zero for objects with no thumbnail

<br />

|                 Returns                 ||
|-------|----------------------------------|
| `int` | the thumbnail format code <br /> |

### getThumbPixHeight

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

```
public int getThumbPixHeight ()
```

Returns the height of the MTP object's thumbnail in pixels Will be zero for objects with no thumbnail

<br />

|              Returns               ||
|-------|-----------------------------|
| `int` | the thumbnail height <br /> |

### getThumbPixHeightLong

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

```
public long getThumbPixHeightLong ()
```

Returns the height of the MTP object's thumbnail in pixels Will be zero for objects with no thumbnail

<br />

|               Returns               ||
|--------|-----------------------------|
| `long` | the thumbnail height <br /> |

### getThumbPixWidth

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

```
public int getThumbPixWidth ()
```

Returns the width of the MTP object's thumbnail in pixels Will be zero for objects with no thumbnail

<br />

|              Returns              ||
|-------|----------------------------|
| `int` | the thumbnail width <br /> |

### getThumbPixWidthLong

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

```
public long getThumbPixWidthLong ()
```

Returns the width of the MTP object's thumbnail in pixels Will be zero for objects with no thumbnail

<br />

|              Returns               ||
|--------|----------------------------|
| `long` | the thumbnail width <br /> |