Android Guides | Samples

Java.Lang.Runtime Class

Allows Java applications to interface with the environment in which they are running.

See Also: Runtime

Syntax

[Android.Runtime.Register("java/lang/Runtime", DoNotGenerateAcw=true)]
public class Runtime : Object

Remarks

Allows Java applications to interface with the environment in which they are running. Applications can not create an instance of this class, but they can get a singleton instance by invoking Runtime.GetRuntime.

See Also

[Android Documentation]

Requirements

Namespace: Java.Lang
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1

The members of Java.Lang.Runtime are listed below.

See Also: Object

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

AddShutdownHook(Thread)
Registers a VM shutdown hook.
AvailableProcessors() : Int32
Returns the number of processor cores available to the VM, at least 1.
Exec(String) : Process
Executes the specified program in a separate native process.
Exec(String[]) : Process
Executes the specified command and its arguments in a separate native process.
Exec(String, String[]) : Process
Executes the specified program in a separate native process.
Exec(String[], String[]) : Process
Executes the specified command and its arguments in a separate native process.
Exec(String, String[], File) : Process
Executes the specified program in a separate native process.
Exec(String[], String[], File) : Process
Executes the specified command and its arguments in a separate native process.
Exit(Int32)
Causes the VM to stop running and the program to exit.
FreeMemory() : Int64
Returns the number of bytes currently available on the heap without expanding the heap.
Gc()
Indicates to the VM that it would be a good time to run the garbage collector.
GetLocalizedInputStream(Stream) : Stream
Returns the localized version of the specified input stream.
GetLocalizedOutputStream(Stream) : Stream
Returns the localized version of the specified output stream.
static
GetRuntime() : Runtime
Returns the single Runtime instance for the current application.
Halt(Int32)
Causes the VM to stop running, and the program to exit with the given return code.
Load(String)
Loads the shared library found at the given absolute path.
LoadAsync(String) : Task
LoadLibrary(String)
Loads a shared library.
LoadLibraryAsync(String) : Task
MaxMemory() : Int64
Returns the maximum number of bytes the heap can expand to.
RemoveShutdownHook(Thread) : Boolean
Unregisters a previously registered VM shutdown hook.
RunFinalization()
Provides a hint to the runtime that it would be useful to attempt to perform any outstanding object finalization.
static
RunFinalizersOnExit(Boolean)
Sets the flag that indicates whether all objects are finalized when the runtime is about to exit.
TotalMemory() : Int64
Returns the number of bytes taken by the heap at its current size.
TraceInstructions(Boolean)
Switches the output of debug information for instructions on or off.
TraceMethodCalls(Boolean)
Switches the output of debug information for methods on or off.