Added in [API level 10](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/nfc/tech/IsoDep#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/nfc/tech/IsoDep#inhmethods)

# IsoDep

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/nfc/tech/IsoDep "View this page in Kotlin") \|Java


`
public

final

class
IsoDep
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


implements

https://developer.android.com/reference/android/nfc/tech/TagTechnology


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.nfc.tech.IsoDep |

<br />

*** ** * ** ***

Provides access to ISO-DEP (ISO 14443-4) properties and I/O operations on a `https://developer.android.com/reference/android/nfc/Tag`.

Acquire an `https://developer.android.com/reference/android/nfc/tech/IsoDep` object using `https://developer.android.com/reference/android/nfc/tech/IsoDep#get(android.nfc.Tag)`.

The primary ISO-DEP I/O operation is `https://developer.android.com/reference/android/nfc/tech/IsoDep#transceive(byte[])`. Applications must
implement their own protocol stack on top of `https://developer.android.com/reference/android/nfc/tech/IsoDep#transceive(byte[])`.

Tags that enumerate the `https://developer.android.com/reference/android/nfc/tech/IsoDep` technology in `https://developer.android.com/reference/android/nfc/Tag#getTechList()`
will also enumerate
`https://developer.android.com/reference/android/nfc/tech/NfcA` or `https://developer.android.com/reference/android/nfc/tech/NfcB` (since IsoDep builds on top of either of these).

**Note:** Methods that perform I/O operations
require the `https://developer.android.com/reference/android/Manifest.permission#NFC` permission.

## Summary

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/nfc/tech/IsoDep#close()() ` Disable I/O operations to the tag from this `https://developer.android.com/reference/android/nfc/tech/TagTechnology` object, and release resources. |
| ` void` | ` https://developer.android.com/reference/android/nfc/tech/IsoDep#connect()() ` Enable I/O operations to the tag from this `https://developer.android.com/reference/android/nfc/tech/TagTechnology` object. |
| ` static https://developer.android.com/reference/android/nfc/tech/IsoDep` | ` https://developer.android.com/reference/android/nfc/tech/IsoDep#get(android.nfc.Tag)(https://developer.android.com/reference/android/nfc/Tag tag) ` Get an instance of `https://developer.android.com/reference/android/nfc/tech/IsoDep` for the given tag. |
| ` byte[]` | ` https://developer.android.com/reference/android/nfc/tech/IsoDep#getHiLayerResponse()() ` Return the higher layer response bytes for `https://developer.android.com/reference/android/nfc/tech/NfcB` tags. |
| ` byte[]` | ` https://developer.android.com/reference/android/nfc/tech/IsoDep#getHistoricalBytes()() ` Return the ISO-DEP historical bytes for `https://developer.android.com/reference/android/nfc/tech/NfcA` tags. |
| ` int` | ` https://developer.android.com/reference/android/nfc/tech/IsoDep#getMaxTransceiveLength()() ` Return the maximum number of bytes that can be sent with `https://developer.android.com/reference/android/nfc/tech/IsoDep#transceive(byte[])`. |
| ` https://developer.android.com/reference/android/nfc/Tag` | ` https://developer.android.com/reference/android/nfc/tech/IsoDep#getTag()() ` Get the `https://developer.android.com/reference/android/nfc/Tag` object backing this `https://developer.android.com/reference/android/nfc/tech/TagTechnology` object. |
| ` int` | ` https://developer.android.com/reference/android/nfc/tech/IsoDep#getTimeout()() ` Get the current timeout for `https://developer.android.com/reference/android/nfc/tech/IsoDep#transceive(byte[])` in milliseconds. |
| ` boolean` | ` https://developer.android.com/reference/android/nfc/tech/IsoDep#isConnected()() ` Helper to indicate if I/O operations should be possible. |
| ` boolean` | ` https://developer.android.com/reference/android/nfc/tech/IsoDep#isExtendedLengthApduSupported()() ` <br /> Standard APDUs have a 1-byte length field, allowing a maximum of 255 payload bytes, which results in a maximum APDU length of 261 bytes. |
| ` void` | ` https://developer.android.com/reference/android/nfc/tech/IsoDep#setTimeout(int)(int timeout) ` Set the timeout of `https://developer.android.com/reference/android/nfc/tech/IsoDep#transceive(byte[])` in milliseconds. |
| ` byte[]` | ` https://developer.android.com/reference/android/nfc/tech/IsoDep#transceive(byte[])(byte[] data) ` Send raw ISO-DEP data to the tag and receive the response. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||
| From interface ` https://developer.android.com/reference/android/nfc/tech/TagTechnology ` |---|---| | ` abstract void` | ` https://developer.android.com/reference/android/nfc/tech/TagTechnology#close()() ` Disable I/O operations to the tag from this `https://developer.android.com/reference/android/nfc/tech/TagTechnology` object, and release resources. | | ` abstract void` | ` https://developer.android.com/reference/android/nfc/tech/TagTechnology#connect()() ` Enable I/O operations to the tag from this `https://developer.android.com/reference/android/nfc/tech/TagTechnology` object. | | ` abstract https://developer.android.com/reference/android/nfc/Tag` | ` https://developer.android.com/reference/android/nfc/tech/TagTechnology#getTag()() ` Get the `https://developer.android.com/reference/android/nfc/Tag` object backing this `https://developer.android.com/reference/android/nfc/tech/TagTechnology` object. | | ` abstract boolean` | ` https://developer.android.com/reference/android/nfc/tech/TagTechnology#isConnected()() ` Helper to indicate if I/O operations should be possible. | ||
| From interface ` https://developer.android.com/reference/java/io/Closeable ` |---|---| | ` abstract void` | ` https://developer.android.com/reference/java/io/Closeable#close()() ` Closes this stream and releases any system resources associated with it. | ||
| From interface ` https://developer.android.com/reference/java/lang/AutoCloseable ` |---|---| | ` abstract void` | ` https://developer.android.com/reference/java/lang/AutoCloseable#close()() ` Closes this resource, relinquishing any underlying resources. | ||

## Public methods

### close

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

```
public void close ()
```

Disable I/O operations to the tag from this `https://developer.android.com/reference/android/nfc/tech/TagTechnology` object, and release resources.

Also causes all blocked I/O operations on other thread to be canceled and
return with `https://developer.android.com/reference/java/io/IOException`.

Requires the `https://developer.android.com/reference/android/Manifest.permission#NFC` permission.

<br />

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/IOException` |   |

### connect

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

```
public void connect ()
```

Enable I/O operations to the tag from this `https://developer.android.com/reference/android/nfc/tech/TagTechnology` object.

May cause RF activity and may block. Must not be called
from the main application thread. A blocked call will be canceled with
`https://developer.android.com/reference/java/io/IOException` by calling `https://developer.android.com/reference/android/nfc/tech/TagTechnology#close()` from another thread.

Only one `https://developer.android.com/reference/android/nfc/tech/TagTechnology` object can be connected to a `https://developer.android.com/reference/android/nfc/Tag` at a time.

Applications must call `https://developer.android.com/reference/android/nfc/tech/TagTechnology#close()` when I/O operations are complete.

Requires the `https://developer.android.com/reference/android/Manifest.permission#NFC` permission.

<br />

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/IOException` |   |

### get

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

```
public static IsoDep get (Tag tag)
```

Get an instance of `https://developer.android.com/reference/android/nfc/tech/IsoDep` for the given tag.

Does not cause any RF activity and does not block.

Returns null if `https://developer.android.com/reference/android/nfc/tech/IsoDep` was not enumerated in `https://developer.android.com/reference/android/nfc/Tag#getTechList()`.
This indicates the tag does not support ISO-DEP.

<br />

| Parameters ||
|---|---|
| `tag` | `Tag`: an ISO-DEP compatible tag <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/nfc/tech/IsoDep` | ISO-DEP object <br /> |

### getHiLayerResponse

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

```
public byte[] getHiLayerResponse ()
```

Return the higher layer response bytes for `https://developer.android.com/reference/android/nfc/tech/NfcB` tags.

Does not cause any RF activity and does not block.

The higher layer response bytes can be used to help identify a tag.
They are present only on `https://developer.android.com/reference/android/nfc/tech/IsoDep` tags that are based on `https://developer.android.com/reference/android/nfc/tech/NfcB`
RF technology. If this tag is not `https://developer.android.com/reference/android/nfc/tech/NfcB` then null is returned.

In ISO 14443-4 terminology, the higher layer bytes are a subset of the
ATTRIB response.

<br />

| Returns ||
|---|---|
| `byte[]` | ISO-DEP historical bytes, or null if this is not a `https://developer.android.com/reference/android/nfc/tech/NfcB` tag <br /> |

### getHistoricalBytes

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

```
public byte[] getHistoricalBytes ()
```

Return the ISO-DEP historical bytes for `https://developer.android.com/reference/android/nfc/tech/NfcA` tags.

Does not cause any RF activity and does not block.

The historical bytes can be used to help identify a tag. They are present
only on `https://developer.android.com/reference/android/nfc/tech/IsoDep` tags that are based on `https://developer.android.com/reference/android/nfc/tech/NfcA` RF technology.
If this tag is not `https://developer.android.com/reference/android/nfc/tech/NfcA` then null is returned.

In ISO 14443-4 terminology, the historical bytes are a subset of the RATS
response.

<br />

| Returns ||
|---|---|
| `byte[]` | ISO-DEP historical bytes, or null if this is not a `https://developer.android.com/reference/android/nfc/tech/NfcA` tag <br /> |

### getMaxTransceiveLength

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

```
public int getMaxTransceiveLength ()
```

Return the maximum number of bytes that can be sent with `https://developer.android.com/reference/android/nfc/tech/IsoDep#transceive(byte[])`.

<br />

| Returns ||
|---|---|
| `int` | the maximum number of bytes that can be sent with `https://developer.android.com/reference/android/nfc/tech/IsoDep#transceive(byte[])`. <br /> |

### getTag

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

```
public Tag getTag ()
```

Get the `https://developer.android.com/reference/android/nfc/Tag` object backing this `https://developer.android.com/reference/android/nfc/tech/TagTechnology` object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/nfc/Tag` | the `https://developer.android.com/reference/android/nfc/Tag` backing this `https://developer.android.com/reference/android/nfc/tech/TagTechnology` object. <br /> |

### getTimeout

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

```
public int getTimeout ()
```

Get the current timeout for `https://developer.android.com/reference/android/nfc/tech/IsoDep#transceive(byte[])` in milliseconds.

Requires the `https://developer.android.com/reference/android/Manifest.permission#NFC` permission.

<br />

| Returns ||
|---|---|
| `int` | timeout value in milliseconds <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/SecurityException` | if the tag object is reused after the tag has left the field |

### isConnected

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

```
public boolean isConnected ()
```

Helper to indicate if I/O operations should be possible.

Returns true if `https://developer.android.com/reference/android/nfc/tech/TagTechnology#connect()` has completed, and `https://developer.android.com/reference/android/nfc/tech/TagTechnology#close()` has not been
called, and the `https://developer.android.com/reference/android/nfc/Tag` is not known to be out of range.

Does not cause RF activity, and does not block.

<br />

| Returns ||
|---|---|
| `boolean` | true if I/O operations should be possible <br /> |

### isExtendedLengthApduSupported

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

```
public boolean isExtendedLengthApduSupported ()
```

<br />

Standard APDUs have a 1-byte length field, allowing a maximum of
255 payload bytes, which results in a maximum APDU length of 261 bytes.

Extended length APDUs have a 3-byte length field, allowing 65535
payload bytes.

Some NFC adapters, like the one used in the Nexus S and the Galaxy Nexus
do not support extended length APDUs. They are expected to be well-supported
in the future though. Use this method to check for extended length APDU
support.

<br />

| Returns ||
|---|---|
| `boolean` | whether the NFC adapter on this device supports extended length APDUs. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/SecurityException` | if the tag object is reused after the tag has left the field |

### setTimeout

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

```
public void setTimeout (int timeout)
```

Set the timeout of `https://developer.android.com/reference/android/nfc/tech/IsoDep#transceive(byte[])` in milliseconds.

The timeout only applies to ISO-DEP `https://developer.android.com/reference/android/nfc/tech/IsoDep#transceive(byte[])`, and is
reset to a default value when `https://developer.android.com/reference/android/nfc/tech/IsoDep#close()` is called.

Setting a longer timeout may be useful when performing
transactions that require a long processing time on the tag
such as key generation.

Requires the `https://developer.android.com/reference/android/Manifest.permission#NFC` permission.

<br />

| Parameters ||
|---|---|
| `timeout` | `int`: timeout value in milliseconds <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/SecurityException` | if the tag object is reused after the tag has left the field |

### transceive

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

```
public byte[] transceive (byte[] data)
```

Send raw ISO-DEP data to the tag and receive the response.

Applications must only send the INF payload, and not the start of frame and
end of frame indicators. Applications do not need to fragment the payload, it
will be automatically fragmented and defragmented by `https://developer.android.com/reference/android/nfc/tech/IsoDep#transceive(byte[])` if
it exceeds FSD/FSC limits.

Use `https://developer.android.com/reference/android/nfc/tech/IsoDep#getMaxTransceiveLength()` to retrieve the maximum number of bytes
that can be sent with `https://developer.android.com/reference/android/nfc/tech/IsoDep#transceive(byte[])`.

This is an I/O operation and will block until complete. It must
not be called from the main application thread. A blocked call will be canceled with
`https://developer.android.com/reference/java/io/IOException` if `https://developer.android.com/reference/android/nfc/tech/IsoDep#close()` is called from another thread.

Requires the `https://developer.android.com/reference/android/Manifest.permission#NFC` permission.

<br />

| Parameters ||
|---|---|
| `data` | `byte`: command bytes to send, must not be null <br /> |

| Returns ||
|---|---|
| `byte[]` | response bytes received, will not be null <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/android/nfc/TagLostException` | if the tag leaves the field |
| `https://developer.android.com/reference/java/io/IOException` | if there is an I/O failure, or this operation is canceled |
| `https://developer.android.com/reference/java/lang/SecurityException` | if the tag object is reused after the tag has left the field |