# MidiDeviceInfo.PortInfo

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# PortInfo

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/media/midi/MidiDeviceInfo.PortInfo "View this page in Java")  

```
class PortInfo
```

|---|------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                           ||
| ↳ | [android.media.midi.MidiDeviceInfo.PortInfo](https://developer.android.com/reference/kotlin/android/media/midi/MidiDeviceInfo.PortInfo#) |

Contains information about an input or output port.

## Summary

|                                                                                                                  Constants                                                                                                                   ||
|----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [TYPE_INPUT](https://developer.android.com/reference/kotlin/android/media/midi/MidiDeviceInfo.PortInfo#TYPE_INPUT:kotlin.Int) Port type for input ports    |
| static[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [TYPE_OUTPUT](https://developer.android.com/reference/kotlin/android/media/midi/MidiDeviceInfo.PortInfo#TYPE_OUTPUT:kotlin.Int) Port type for output ports |

|                                                                                                                                                                                                                                                 Public methods                                                                                                                                                                                                                                                 ||
|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getName](https://developer.android.com/reference/kotlin/android/media/midi/MidiDeviceInfo.PortInfo#getName())`()` Returns the name of the port, or empty string if the port has no name                                                                                                                                                                                                                                    |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)        | [getPortNumber](https://developer.android.com/reference/kotlin/android/media/midi/MidiDeviceInfo.PortInfo#getPortNumber())`()` Returns the port number of the port                                                                                                                                                                                                                                                          |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)        | [getType](https://developer.android.com/reference/kotlin/android/media/midi/MidiDeviceInfo.PortInfo#getType())`()` Returns the port type of the port (either[TYPE_INPUT](https://developer.android.com/reference/kotlin/android/media/midi/MidiDeviceInfo.PortInfo#TYPE_INPUT:kotlin.Int)or[TYPE_OUTPUT](https://developer.android.com/reference/kotlin/android/media/midi/MidiDeviceInfo.PortInfo#TYPE_OUTPUT:kotlin.Int)) |

## Constants

### TYPE_INPUT

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val TYPE_INPUT: Int
```

Port type for input ports  

    Value: 1

### TYPE_OUTPUT

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
static val TYPE_OUTPUT: Int
```

Port type for output ports  

    Value: 2

## Public methods

### getName

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getName(): String!
```

Returns the name of the port, or empty string if the port has no name

|                                              Return                                              ||
|-----------------------------------------------------------------------------------|---------------|
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | the port name |

### getPortNumber

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getPortNumber(): Int
```

Returns the port number of the port

|                                           Return                                            ||
|----------------------------------------------------------------------------|-----------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | the port number |

### getType

Added in[API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
fun getType(): Int
```

Returns the port type of the port (either[TYPE_INPUT](https://developer.android.com/reference/kotlin/android/media/midi/MidiDeviceInfo.PortInfo#TYPE_INPUT:kotlin.Int)or[TYPE_OUTPUT](https://developer.android.com/reference/kotlin/android/media/midi/MidiDeviceInfo.PortInfo#TYPE_OUTPUT:kotlin.Int))

|                                          Return                                           ||
|----------------------------------------------------------------------------|---------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | the port type |