Android APIs
public final class

MidiManager

extends Object
java.lang.Object
   ↳ android.media.midi.MidiManager

Class Overview

This class is the public application interface to the MIDI service.

You can obtain an instance of this class by calling Context.getSystemService().

MidiManager manager = (MidiManager) getSystemService(Context.MIDI_SERVICE);

Summary

Nested Classes
class MidiManager.DeviceCallback Callback class used for clients to receive MIDI device added and removed notifications  
interface MidiManager.OnDeviceOpenedListener Listener class used for receiving the results of openDevice(MidiDeviceInfo, MidiManager.OnDeviceOpenedListener, Handler) and openBluetoothDevice(BluetoothDevice, MidiManager.OnDeviceOpenedListener, Handler)  
Public Methods
MidiDeviceInfo[] getDevices()
Gets the list of all connected MIDI devices.
void openBluetoothDevice(BluetoothDevice bluetoothDevice, MidiManager.OnDeviceOpenedListener listener, Handler handler)
Opens a Bluetooth MIDI device for reading and writing.
void openDevice(MidiDeviceInfo deviceInfo, MidiManager.OnDeviceOpenedListener listener, Handler handler)
Opens a MIDI device for reading and writing.
void registerDeviceCallback(MidiManager.DeviceCallback callback, Handler handler)
Registers a callback to receive notifications when MIDI devices are added and removed.
void unregisterDeviceCallback(MidiManager.DeviceCallback callback)
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public MidiDeviceInfo[] getDevices ()

Added in API level 23

Gets the list of all connected MIDI devices.

Returns
  • an array of all MIDI devices

public void openBluetoothDevice (BluetoothDevice bluetoothDevice, MidiManager.OnDeviceOpenedListener listener, Handler handler)

Added in API level 23

Opens a Bluetooth MIDI device for reading and writing.

Parameters
bluetoothDevice a BluetoothDevice to open as a MIDI device
listener a MidiManager.OnDeviceOpenedListener to be called to receive the result
handler the Handler that will be used for delivering the result. If handler is null, then the thread used for the listener is unspecified.

public void openDevice (MidiDeviceInfo deviceInfo, MidiManager.OnDeviceOpenedListener listener, Handler handler)

Added in API level 23

Opens a MIDI device for reading and writing.

Parameters
deviceInfo a MidiDeviceInfo to open
listener a MidiManager.OnDeviceOpenedListener to be called to receive the result
handler the Handler that will be used for delivering the result. If handler is null, then the thread used for the listener is unspecified.

public void registerDeviceCallback (MidiManager.DeviceCallback callback, Handler handler)

Added in API level 23

Registers a callback to receive notifications when MIDI devices are added and removed.

Parameters
callback a MidiManager.DeviceCallback for MIDI device notifications
handler The Handler that will be used for delivering the device notifications. If handler is null, then the thread used for the callback is unspecified.

public void unregisterDeviceCallback (MidiManager.DeviceCallback callback)

Added in API level 23
Parameters
callback a MidiManager.DeviceCallback to unregister