Stay organized with collections
Save and categorize content based on your preferences.
RttTextStream
class RttTextStream
Provides methods to read and write RTT data to/from the in-call app.
Summary
Public methods |
String! |
Reads a string from the in-call app, blocking if there is no data available.
|
String! |
Non-blocking version of read() .
|
Unit |
Writes the string {@param input} into the text stream to the UI for this RTT call.
|
Public methods
read
fun read(): String!
Reads a string from the in-call app, blocking if there is no data available. Returns null
if the RTT conversation has been terminated and there is no further data to read.
This method is not thread-safe -- calling it from multiple threads simultaneously may lead to interleaved text.
Return |
String! |
A string containing text entered by the user, or null if the conversation has been terminated or if there was an error while reading. |
fun readImmediately(): String!
Non-blocking version of read()
. Returns null
if there is nothing to be read.
Return |
String! |
A string containing text entered by the user, or null if the user has not entered any new text yet. |
write
fun write(input: String!): Unit
Writes the string {@param input} into the text stream to the UI for this RTT call. Since RTT transmits text in real-time, this method should be called as often as text snippets are received from the remote user, even if it is only one character.
This method is not thread-safe -- calling it from multiple threads simultaneously may lead to interleaved text.
Parameters |
input |
String!: The message to send to the in-call app. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# Connection.RttTextStream\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nRttTextStream\n=============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/telecom/Connection.RttTextStream \"View this page in Java\") \n\n```\nclass RttTextStream\n```\n\n|---|-----------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.telecom.Connection.RttTextStream](#) |\n\nProvides methods to read and write RTT data to/from the in-call app.\n\nSummary\n-------\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [read](#read())`()` Reads a string from the in-call app, blocking if there is no data available. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [readImmediately](#readImmediately())`()` Non-blocking version of [read()](#read()). |\n| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [write](#write(kotlin.String))`(`input:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Writes the string {@param input} into the text stream to the UI for this RTT call. |\n\nPublic methods\n--------------\n\n### read\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun read(): String!\n```\n\nReads a string from the in-call app, blocking if there is no data available. Returns `null` if the RTT conversation has been terminated and there is no further data to read.\n\nThis method is not thread-safe -- calling it from multiple threads simultaneously may lead to interleaved text.\n\n| Return ||\n|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | A string containing text entered by the user, or `null` if the conversation has been terminated or if there was an error while reading. |\n\n### readImmediately\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun readImmediately(): String!\n```\n\nNon-blocking version of [read()](#read()). Returns `null` if there is nothing to be read.\n\n| Return ||\n|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | A string containing text entered by the user, or `null` if the user has not entered any new text yet. |\n\n### write\n\nAdded in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun write(input: String!): Unit\n```\n\nWrites the string {@param input} into the text stream to the UI for this RTT call. Since RTT transmits text in real-time, this method should be called as often as text snippets are received from the remote user, even if it is only one character.\n\nThis method is not thread-safe -- calling it from multiple threads simultaneously may lead to interleaved text.\n\n| Parameters ||\n|---------|----------------------------------------------------------------------------------------------------------------------------|\n| `input` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: The message to send to the in-call app. |"]]