Android Guides | Samples

Android.Hardware.Usb.UsbAccessory Class

A class representing a USB accessory, which is an external hardware component that communicates with an android application over USB.

See Also: UsbAccessory

Syntax

[Android.Runtime.Register("android/hardware/usb/UsbAccessory", DoNotGenerateAcw=true)]
public class UsbAccessory : Object, IParcelable, IDisposable

Remarks

A class representing a USB accessory, which is an external hardware component that communicates with an android application over USB. The accessory is the USB host and android the device side of the USB connection.

When the accessory connects, it reports its manufacturer and model names, the version of the accessory, and a user visible description of the accessory to the device. The manufacturer, model and version strings are used by the USB Manager to choose an appropriate application for the accessory. The accessory may optionally provide a unique serial number and a URL to for the accessory's website to the device as well.

An instance of this class is sent to the application via the UsbManager.ActionUsbAccessoryAttached Intent. The application can then call UsbManager.OpenAccessory(UsbAccessory) to open a file descriptor for reading and writing data to and from the accessory.

Developer Guides

For more information about communicating with USB hardware, read the USB developer guide.

[Android Documentation]

Requirements

Namespace: Android.Hardware.Usb
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 12

The members of Android.Hardware.Usb.UsbAccessory are listed below.

See Also: Object

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

[read-only]
static
CreatorIParcelableCreator.
[read-only]
DescriptionString. Returns a user visible description of the accessory.
[read-only]
ManufacturerString. Returns the manufacturer name of the accessory.
[read-only]
ModelString. Returns the model name of the accessory.
[read-only]
SerialString. Returns the unique serial number for the accessory.
[read-only]
UriString. Returns the URI for the accessory.
[read-only]
VersionString. Returns the version of the accessory.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

DescribeContents() : Int32
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
WriteToParcel(Parcel, ParcelableWriteFlags)
Flatten this object in to a Parcel.