Added in API level 12

MtpObjectInfo


class MtpObjectInfo
kotlin.Any
   ↳ android.mtp.MtpObjectInfo

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

Builds a new object info instance.

Public methods
Int

Returns the association description for the MTP object Will be zero objects that are not of format android.mtp.MtpConstants#FORMAT_ASSOCIATION

Int

Returns the association type for the MTP object Will be zero objects that are not of format android.mtp.MtpConstants#FORMAT_ASSOCIATION For directories the association type is typically android.mtp.MtpConstants#ASSOCIATION_TYPE_GENERIC_FOLDER

Int

Returns the size of the MTP object

Long

Returns the size of the MTP object

Long

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

Long

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

Int

Returns the format code for the MTP object

Int

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

Long

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

Int

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

Long

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

Int

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

Long

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

String

Returns a comma separated list of keywords for the MTP object

String

Returns the name of the MTP object

Int

Returns the object handle for the MTP object

Int

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

Int

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

Int

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

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

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

Int

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

Long

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

Int

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

Int

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

Long

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

Int

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

Long

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

Public methods

getAssociationDesc

Added in API level 12
fun getAssociationDesc(): Int

Returns the association description for the MTP object Will be zero objects that are not of format android.mtp.MtpConstants#FORMAT_ASSOCIATION

Return
Int the object's association description

getAssociationType

Added in API level 12
fun getAssociationType(): Int

Returns the association type for the MTP object Will be zero objects that are not of format android.mtp.MtpConstants#FORMAT_ASSOCIATION For directories the association type is typically android.mtp.MtpConstants#ASSOCIATION_TYPE_GENERIC_FOLDER

Return
Int the object's association type

getCompressedSize

Added in API level 12
fun getCompressedSize(): Int

Returns the size of the MTP object

Return
Int the object size

getCompressedSizeLong

Added in API level 24
fun getCompressedSizeLong(): Long

Returns the size of the MTP object

Return
Long the object size

getDateCreated

Added in API level 12
fun getDateCreated(): Long

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

Return
Long the object's creation date

getDateModified

Added in API level 12
fun getDateModified(): Long

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

Return
Long the object's modification date

getFormat

Added in API level 12
fun getFormat(): Int

Returns the format code for the MTP object

Return
Int the format code

getImagePixDepth

Added in API level 12
fun getImagePixDepth(): Int

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

Return
Int the image depth

getImagePixDepthLong

Added in API level 24
fun getImagePixDepthLong(): Long

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

Return
Long the image depth

getImagePixHeight

Added in API level 12
fun getImagePixHeight(): Int

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

Return
Int the image height

getImagePixHeightLong

Added in API level 24
fun getImagePixHeightLong(): Long

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

Return
Long the image height

getImagePixWidth

Added in API level 12
fun getImagePixWidth(): Int

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

Return
Int the image width

getImagePixWidthLong

Added in API level 24
fun getImagePixWidthLong(): Long

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

Return
Long the image width

getKeywords

Added in API level 12
fun getKeywords(): String

Returns a comma separated list of keywords for the MTP object

Return
String the object's keyword list This value cannot be null.

getName

Added in API level 12
fun getName(): String

Returns the name of the MTP object

Return
String the object's name This value cannot be null.

getObjectHandle

Added in API level 12
fun getObjectHandle(): Int

Returns the object handle for the MTP object

Return
Int the object handle

getParent

Added in API level 12
fun getParent(): Int

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

Return
Int the object's parent

getProtectionStatus

Added in API level 12
fun getProtectionStatus(): Int

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

Return
Int the protection status

getSequenceNumber

Added in API level 12
fun getSequenceNumber(): Int

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.

Return
Int the object's sequence number

getSequenceNumberLong

Added in API level 24
fun getSequenceNumberLong(): Long

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.

Return
Long the object's sequence number

getStorageId

Added in API level 12
fun getStorageId(): Int

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

Return
Int the storage ID

getThumbCompressedSize

Added in API level 12
fun getThumbCompressedSize(): Int

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

Return
Int the thumbnail size

getThumbCompressedSizeLong

Added in API level 24
fun getThumbCompressedSizeLong(): Long

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

Return
Long the thumbnail size

getThumbFormat

Added in API level 12
fun getThumbFormat(): Int

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

Return
Int the thumbnail format code

getThumbPixHeight

Added in API level 12
fun getThumbPixHeight(): Int

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

Return
Int the thumbnail height

getThumbPixHeightLong

Added in API level 24
fun getThumbPixHeightLong(): Long

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

Return
Long the thumbnail height

getThumbPixWidth

Added in API level 12
fun getThumbPixWidth(): Int

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

Return
Int the thumbnail width

getThumbPixWidthLong

Added in API level 24
fun getThumbPixWidthLong(): Long

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

Return
Long the thumbnail width