Stay organized with collections
Save and categorize content based on your preferences.
The androidx.javascriptengine library is a static library you can add to your Android application in order to evaluate JavaScript.
Interfaces
Classes
Exceptions
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-05-15 UTC.
[null,null,["Last updated 2025-05-15 UTC."],[],[],null,["# androidx.javascriptengine\n=========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/androidx/javascriptengine/package-summary \"View this page in Java\")\n\nThe androidx.javascriptengine library is a static library you can add to your Android application in order to evaluate JavaScript.\n\nInterfaces\n----------\n\n|----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|\n| [JavaScriptConsoleCallback](/reference/kotlin/androidx/javascriptengine/JavaScriptConsoleCallback) | Can be associated with an isolate to receive and process console messages and events from it. |\n\nClasses\n-------\n\n|----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| [IsolateStartupParameters](/reference/kotlin/androidx/javascriptengine/IsolateStartupParameters) | Class used to set startup parameters for [JavaScriptIsolate](/reference/kotlin/androidx/javascriptengine/JavaScriptIsolate). |\n| [JavaScriptConsoleCallback.ConsoleMessage](/reference/kotlin/androidx/javascriptengine/JavaScriptConsoleCallback.ConsoleMessage) | Representation of a console message, such as produced by console.log. |\n| [JavaScriptIsolate](/reference/kotlin/androidx/javascriptengine/JavaScriptIsolate) | Environment within a [JavaScriptSandbox](/reference/kotlin/androidx/javascriptengine/JavaScriptSandbox) where JavaScript is executed. |\n| [JavaScriptSandbox](/reference/kotlin/androidx/javascriptengine/JavaScriptSandbox) | Sandbox that provides APIs for JavaScript evaluation in a restricted environment. |\n| [TerminationInfo](/reference/kotlin/androidx/javascriptengine/TerminationInfo) | Information about how and why an isolate has terminated. |\n\nExceptions\n----------\n\n|--------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [DataInputException](/reference/kotlin/androidx/javascriptengine/DataInputException) | Indicates that streaming JavaScript code into the JS evaluation environment has failed. |\n| [EvaluationFailedException](/reference/kotlin/androidx/javascriptengine/EvaluationFailedException) | Indicates that an evaluation failed due to a syntax error or exception produced by the script. |\n| [EvaluationResultSizeLimitExceededException](/reference/kotlin/androidx/javascriptengine/EvaluationResultSizeLimitExceededException) | Indicates that a JavaScriptIsolate's evaluation failed due to it returning an oversized result. |\n| [IsolateTerminatedException](/reference/kotlin/androidx/javascriptengine/IsolateTerminatedException) | Exception produced when evaluation is terminated due to the [JavaScriptIsolate](/reference/kotlin/androidx/javascriptengine/JavaScriptIsolate) being closed or due to some crash. |\n| [JavaScriptException](/reference/kotlin/androidx/javascriptengine/JavaScriptException) | Super class for all asynchronous exceptions produced by [evaluateJavaScriptAsync](/reference/kotlin/androidx/javascriptengine/JavaScriptIsolate#evaluateJavaScriptAsync(java.lang.String)). |\n| [MemoryLimitExceededException](/reference/kotlin/androidx/javascriptengine/MemoryLimitExceededException) | Indicates that a JavaScriptIsolate's evaluation failed due to the isolate exceeding its heap size limit. |\n| [SandboxDeadException](/reference/kotlin/androidx/javascriptengine/SandboxDeadException) | Exception thrown when evaluation is terminated due the [JavaScriptSandbox](/reference/kotlin/androidx/javascriptengine/JavaScriptSandbox) being dead. |\n| [SandboxUnsupportedException](/reference/kotlin/androidx/javascriptengine/SandboxUnsupportedException) | Exception thrown when attempting to create a [JavaScriptSandbox](/reference/kotlin/androidx/javascriptengine/JavaScriptSandbox) via [createConnectedInstanceAsync](/reference/kotlin/androidx/javascriptengine/JavaScriptSandbox#createConnectedInstanceAsync(android.content.Context)) when doing so is not supported. |"]]