Skip to content

Most visited

Recently visited

navigation

MtpDeviceInfo

public class MtpDeviceInfo
extends Object

java.lang.Object
   ↳ android.mtp.MtpDeviceInfo


This class encapsulates information about an MTP device. This corresponds to the DeviceInfo Dataset described in section 5.1.1 of the MTP specification.

Summary

Public methods

final int[] getEventsSupported()

Returns event code supported by the device.

final String getManufacturer()

Returns the manufacturer's name for the MTP device

final String getModel()

Returns the model name for the MTP device

final int[] getOperationsSupported()

Returns operation code supported by the device.

final String getSerialNumber()

Returns the unique serial number for the MTP device

final String getVersion()

Returns the version string the MTP device

boolean isEventSupported(int code)

Returns if the given event is supported by the device or not.

boolean isOperationSupported(int code)

Returns if the given operation is supported by the device or not.

Inherited methods

From class java.lang.Object

Public methods

getManufacturer

added in API level 12
String getManufacturer ()

Returns the manufacturer's name for the MTP device

Returns
String the manufacturer name

This value will never be null.

getModel

added in API level 12
String getModel ()

Returns the model name for the MTP device

Returns
String the model name

This value will never be null.

getSerialNumber

added in API level 12
String getSerialNumber ()

Returns the unique serial number for the MTP device

Returns
String the serial number

This value will never be null.

getVersion

added in API level 12
String getVersion ()

Returns the version string the MTP device

Returns
String the device version

This value will never be null.

isEventSupported

added in API level 24
boolean isEventSupported (int code)

Returns if the given event is supported by the device or not.

Parameters
code int: Event code.

Returns
boolean If the given event is supported by the device or not.

isOperationSupported

added in API level 24
boolean isOperationSupported (int code)

Returns if the given operation is supported by the device or not.

Parameters
code int: Operation code.

Returns
boolean If the given operation is supported by the device or not.

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)