Stay organized with collections
Save and categorize content based on your preferences.
Printer
interface Printer
Simple interface for printing text, allowing redirection to various targets. Standard implementations are android.util.LogPrinter
, android.util.StringBuilderPrinter
, and android.util.PrintWriterPrinter
.
Summary
Public methods |
abstract Unit |
Write a line of text to the output.
|
Public methods
println
abstract fun println(x: String!): Unit
Write a line of text to the output. There is no need to terminate the given string with a newline.
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,["# Printer\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nPrinter\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/util/Printer \"View this page in Java\") \n\n```\ninterface Printer\n```\n\n|---------------------------|\n| [android.util.Printer](#) |\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [LogPrinter](/reference/kotlin/android/util/LogPrinter), [PrintStreamPrinter](/reference/kotlin/android/util/PrintStreamPrinter), [PrintWriterPrinter](/reference/kotlin/android/util/PrintWriterPrinter), [StringBuilderPrinter](/reference/kotlin/android/util/StringBuilderPrinter) |-----------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------| | [LogPrinter](/reference/kotlin/android/util/LogPrinter) | Implementation of a [android.util.Printer](#) that sends its output to the system log. | | [PrintStreamPrinter](/reference/kotlin/android/util/PrintStreamPrinter) | Implementation of a [android.util.Printer](#) that sends its output to a [java.io.PrintStream](../../java/io/PrintStream.html#). | | [PrintWriterPrinter](/reference/kotlin/android/util/PrintWriterPrinter) | Implementation of a [android.util.Printer](#) that sends its output to a [java.io.PrintWriter](../../java/io/PrintWriter.html#). | | [StringBuilderPrinter](/reference/kotlin/android/util/StringBuilderPrinter) | Implementation of a [android.util.Printer](#) that sends its output to a [StringBuilder](../../java/lang/StringBuilder.html#). | |\n\nSimple interface for printing text, allowing redirection to various targets. Standard implementations are [android.util.LogPrinter](/reference/kotlin/android/util/LogPrinter), [android.util.StringBuilderPrinter](/reference/kotlin/android/util/StringBuilderPrinter), and [android.util.PrintWriterPrinter](/reference/kotlin/android/util/PrintWriterPrinter).\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [println](#println(kotlin.String))`(`x:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Write a line of text to the output. |\n\nPublic methods\n--------------\n\n### println\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun println(x: String!): Unit\n```\n\nWrite a line of text to the output. There is no need to terminate the given string with a newline."]]