Skip to content

Most visited

Recently visited

navigation

MtpStorageInfo

public final class MtpStorageInfo
extends Object

java.lang.Object
   ↳ android.mtp.MtpStorageInfo


This class encapsulates information about a storage unit on an MTP device. This corresponds to the StorageInfo Dataset described in section 5.2.2 of the MTP specification.

Summary

Public methods

final String getDescription()

Returns the description string for the storage unit.

final long getFreeSpace()

Returns the amount of free space in the storage unit in bytes

final long getMaxCapacity()

Returns the maximum storage capacity for the storage unit in bytes

final int getStorageId()

Returns the storage ID for the storage unit.

final String getVolumeIdentifier()

Returns the volume identifier for the storage unit

Inherited methods

From class java.lang.Object

Public methods

getDescription

added in API level 12
String getDescription ()

Returns the description string for the storage unit. This is typically displayed to the user in the user interface on the MTP host.

Returns
String the storage unit description

This value will never be null.

getFreeSpace

added in API level 12
long getFreeSpace ()

Returns the amount of free space in the storage unit in bytes

Returns
long the amount of free space

getMaxCapacity

added in API level 12
long getMaxCapacity ()

Returns the maximum storage capacity for the storage unit in bytes

Returns
long the maximum capacity

getStorageId

added in API level 12
int getStorageId ()

Returns the storage ID for the storage unit. The storage ID uniquely identifies the storage unit on the MTP device.

Returns
int the storage ID

getVolumeIdentifier

added in API level 12
String getVolumeIdentifier ()

Returns the volume identifier for the storage unit

Returns
String the storage volume identifier

This value will never be null.

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)