/**@class java.lang.Runtime @extends java.lang.Object 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 {@link #getRuntime}(). @see System */ var Runtime = { /**Executes the specified command and its arguments in a separate native process. The new process inherits the environment of the caller. Calling this method is equivalent to calling {@code exec(progArray, null, null)}. @param {Object {java.lang.String[]}} progArray the array containing the program to execute as well as any arguments to the program. @return {Object {java.lang.Process}} the new {@code Process} object that represents the native process. @throws IOException if the requested program can not be executed. */ exec : function( ) {}, /**Executes the specified command and its arguments in a separate native process. The new process uses the environment provided in {@code envp}. Calling this method is equivalent to calling {@code exec(progArray, envp, null)}. @param {Object {java.lang.String[]}} progArray the array containing the program to execute as well as any arguments to the program. @param {Object {java.lang.String[]}} envp the array containing the environment to start the new process in. @return {Object {java.lang.Process}} the new {@code Process} object that represents the native process. @throws IOException if the requested program can not be executed. */ exec : function( ) {}, /**Executes the specified command and its arguments in a separate native process. The new process uses the environment provided in {@code envp} and the working directory specified by {@code directory}. @param {Object {java.lang.String[]}} progArray the array containing the program to execute as well as any arguments to the program. @param {Object {java.lang.String[]}} envp the array containing the environment to start the new process in. @param {Object {File}} directory the directory in which to execute the program. If {@code null}, execute if in the same directory as the parent process. @return {Object {java.lang.Process}} the new {@code Process} object that represents the native process. @throws IOException if the requested program can not be executed. */ exec : function( ) {}, /**Executes the specified program in a separate native process. The new process inherits the environment of the caller. Calling this method is equivalent to calling {@code exec(prog, null, null)}. @param {String} prog the name of the program to execute. @return {Object {java.lang.Process}} the new {@code Process} object that represents the native process. @throws IOException if the requested program can not be executed. */ exec : function( ) {}, /**Executes the specified program in a separate native process. The new process uses the environment provided in {@code envp}. Calling this method is equivalent to calling {@code exec(prog, envp, null)}. @param {String} prog the name of the program to execute. @param {Object {java.lang.String[]}} envp the array containing the environment to start the new process in. @return {Object {java.lang.Process}} the new {@code Process} object that represents the native process. @throws IOException if the requested program can not be executed. */ exec : function( ) {}, /**Executes the specified program in a separate native process. The new process uses the environment provided in {@code envp} and the working directory specified by {@code directory}. @param {String} prog the name of the program to execute. @param {Object {java.lang.String[]}} envp the array containing the environment to start the new process in. @param {Object {File}} directory the directory in which to execute the program. If {@code null}, execute if in the same directory as the parent process. @return {Object {java.lang.Process}} the new {@code Process} object that represents the native process. @throws IOException if the requested program can not be executed. */ exec : function( ) {}, /**Causes the VM to stop running and the program to exit. If {@link #runFinalizersOnExit}(boolean) has been previously invoked with a {@code true} argument, then all objects will be properly garbage-collected and finalized first. Use 0 to signal success to the calling process and 1 to signal failure. This method is unlikely to be useful to an Android application. */ exit : function( ) {}, /**Indicates to the VM that it would be a good time to run the garbage collector. Note that this is a hint only. There is no guarantee that the garbage collector will actually be run. */ gc : function( ) {}, /**Returns the single {@code Runtime} instance for the current application. */ getRuntime : function( ) {}, /**Loads the shared library found at the given absolute path. This should be of the form {@code /path/to/library/libMyLibrary.so}. Most callers should use {@link #loadLibrary}(String) instead, and let the system find the correct file to load. @throws UnsatisfiedLinkError if the library can not be loaded, either because it's not found or because there is something wrong with it. */ load : function( ) {}, /**Loads a shared library. Class loaders have some influence over this process, but for a typical Android app, it works as follows: <p>Given the name {@code "MyLibrary"}, that string will be passed to {@link java.lang.System#mapLibraryName}. That means it would be a mistake for the caller to include the usual {@code "lib"} prefix and {@code ".so"} suffix. <p>That file will then be searched for on the application's native library search path. This consists of the application's own native library directory followed by the system's native library directories. @throws UnsatisfiedLinkError if the library can not be loaded, either because it's not found or because there is something wrong with it. */ loadLibrary : function( ) {}, /**Provides a hint to the runtime that it would be useful to attempt to perform any outstanding object finalization. */ runFinalization : function( ) {}, /**Sets the flag that indicates whether all objects are finalized when the runtime is about to exit. Note that all finalization which occurs when the system is exiting is performed after all running threads have been terminated. @param {Boolean} run {@code true} to enable finalization on exit, {@code false} to disable it. @deprecated This method is unsafe. */ runFinalizersOnExit : function( ) {}, /**Switches the output of debug information for instructions on or off. On Android, this method does nothing. */ traceInstructions : function( ) {}, /**Switches the output of debug information for methods on or off. */ traceMethodCalls : function( ) {}, /**Returns the localized version of the specified input stream. The input stream that is returned automatically converts all characters from the local character set to Unicode after reading them from the underlying stream. @param {Object {InputStream}} stream the input stream to localize. @return {Object {java.io.InputStream}} the localized input stream. @deprecated Use {@link InputStreamReader} instead. */ getLocalizedInputStream : function( ) {}, /**Returns the localized version of the specified output stream. The output stream that is returned automatically converts all characters from Unicode to the local character set before writing them to the underlying stream. @param {Object {OutputStream}} stream the output stream to localize. @return {Object {java.io.OutputStream}} the localized output stream. @deprecated Use {@link OutputStreamWriter} instead. */ getLocalizedOutputStream : function( ) {}, /**Registers a VM shutdown hook. A shutdown hook is a {@code Thread} that is ready to run, but has not yet been started. All registered shutdown hooks will be executed when the VM terminates normally (typically when the {@link #exit}(int) method is called). <p><i>Note that on Android, the application lifecycle does not include VM termination, so calling this method will not ensure that your code is run</i>. Instead, you should use the most appropriate lifecycle notification ({@code Activity.onPause}, say). <p>Shutdown hooks are run concurrently and in an unspecified order. Hooks failing due to an unhandled exception are not a problem, but the stack trace might be printed to the console. Once initiated, the whole shutdown process can only be terminated by calling {@code halt()}. <p>If {@link #runFinalizersOnExit}(boolean) has been called with a {@code true} argument, garbage collection and finalization will take place after all hooks are either finished or have failed. Then the VM terminates. <p>It is recommended that shutdown hooks do not do any time-consuming activities, in order to not hold up the shutdown process longer than necessary. @param {Object {Thread}} hook the shutdown hook to register. @throws IllegalArgumentException if the hook has already been started or if it has already been registered. @throws IllegalStateException if the VM is already shutting down. */ addShutdownHook : function( ) {}, /**Unregisters a previously registered VM shutdown hook. @param {Object {Thread}} hook the shutdown hook to remove. @return {Boolean} {@code true} if the hook has been removed successfully; {@code false} otherwise. @throws IllegalStateException if the VM is already shutting down. */ removeShutdownHook : function( ) {}, /**Causes the VM to stop running, and the program to exit with the given return code. Use 0 to signal success to the calling process and 1 to signal failure. Neither shutdown hooks nor finalizers are run before exiting. This method is unlikely to be useful to an Android application. */ halt : function( ) {}, /**Returns the number of processor cores available to the VM, at least 1. Traditionally this returned the number currently online, but many mobile devices are able to take unused cores offline to save power, so releases newer than Android 4.2 (Jelly Bean) return the maximum number of cores that could be made available if there were no power or heat constraints. */ availableProcessors : function( ) {}, /**Returns the number of bytes currently available on the heap without expanding the heap. See {@link #totalMemory} for the heap's current size. When these bytes are exhausted, the heap may expand. See {@link #maxMemory} for that limit. */ freeMemory : function( ) {}, /**Returns the number of bytes taken by the heap at its current size. The heap may expand or contract over time, as the number of live objects increases or decreases. See {@link #maxMemory} for the maximum heap size, and {@link #freeMemory} for an idea of how much the heap could currently contract. */ totalMemory : function( ) {}, /**Returns the maximum number of bytes the heap can expand to. See {@link #totalMemory} for the current number of bytes taken by the heap, and {@link #freeMemory} for the current number of those bytes actually used by live objects. */ maxMemory : function( ) {}, };