Table of Contents

Class AndroidWebViewApplication

Namespace
VpnHood.AppUi.Hosting.WebView.Android
Assembly
VpnHood.AppUi.Hosting.WebView.Android.dll

Represents the web view UI's application on Android: a head's application derives from it, says how its app starts (CreateInitParams()), and carries only what the system reads, its [Application] attribute.

public abstract class AndroidWebViewApplication : Application, IComponentCallbacks2, IComponentCallbacks, IJavaObject, IJavaPeerable, IDisposable
Inheritance
AndroidWebViewApplication
Implements
Inherited Members

Remarks

Android makes it in every process of the package, the VPN service's and the Quick Settings tile's too, and the app starts only in the app's own; the page is the activity's. A head that must do something before the app starts, as an analytics SDK that reports from every process, overrides OnCreate() and calls this one after.

Constructors

AndroidWebViewApplication(nint, JniHandleOwnership)

Represents the web view UI's application on Android: a head's application derives from it, says how its app starts (CreateInitParams()), and carries only what the system reads, its [Application] attribute.

protected AndroidWebViewApplication(nint javaReference, JniHandleOwnership transfer)

Parameters

javaReference nint

The handle of the Java object.

transfer JniHandleOwnership

How the handle is owned.

Remarks

Android makes it in every process of the package, the VPN service's and the Quick Settings tile's too, and the app starts only in the app's own; the page is the activity's. A head that must do something before the app starts, as an analytics SDK that reports from every process, overrides OnCreate() and calls this one after.

Methods

CreateInitParams()

Creates the head's init params, asked for only in the app's own process.

protected abstract AppInitParams CreateInitParams()

Returns

AppInitParams

The init params.

OnCreate()

Called when the application is starting, before any activity, service, or receiver objects (excluding content providers) have been created.

public override void OnCreate()

Remarks

Called when the application is starting, before any activity, service, or receiver objects (excluding content providers) have been created. Implementations should be as quick as possible (for example using lazy initialization of state) since the time spent in this function directly impacts the performance of starting the first activity, service, or receiver in a process.

If you override this method, be sure to call super.onCreate().

Be aware that direct boot may also affect callback order on Android Build.VERSION_CODES.N and later devices. Until the user unlocks the device, only direct boot aware components are allowed to run. You should consider that all direct boot unaware components, including such ContentProvider, are disabled until user unlock happens, especially when component callback order matters.

Android reference for

    <pre><code class="lang-csharp">android.app.Application.onCreate</code></pre>

    .</a>
</format>

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Exceptions

OverflowException

A duration in a built-in access key is out of range.

InvalidDataException

A built-in access key decodes to JSON null.

JsonException

A built-in access key holds no valid access key.

NotSupportedException

A built-in access key's version is not one the app reads.

FormatException

A built-in access key is no valid Base64, or an endpoint or a duration in it is not valid.

InvalidOperationException

The process's or the package's identity cannot be read; or, in the app's own process, Android names no cache folder, the init params name no storage folder, the platform has no local app data folder, Android names no folder kept out of backups, or a debug build's storage check fails.

OnTerminate()

This method is for use in emulated process environments.

public override void OnTerminate()

Remarks

This method is for use in emulated process environments. It will never be called on a production Android device, where processes are removed by simply killing them; no user code (including this callback) is executed when doing so. If you override this method you must call through to the superclass implementation.

Android reference for

    <pre><code class="lang-csharp">android.app.Application.onTerminate</code></pre>

    .</a>
</format>

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.