Android.Net.VpnService.Prepare Method
Prepare to establish a VPN connection.

Syntax

[Android.Runtime.Register("prepare", "(Landroid/content/Context;)Landroid/content/Intent;", "")]
public static Android.Content.Intent Prepare (Android.Content.Context context)

See Also

VpnService.OnRevoke

Parameters

context
Documentation for this section has not yet been entered.

Returns

Documentation for this section has not yet been entered.

Remarks

Prepare to establish a VPN connection. This method returns null if the VPN application is already prepared or if the user has previously consented to the VPN application. Otherwise, it returns an Android.Content.Intent to a system activity. The application should launch the activity using Android.App.Activity.StartActivityForResult(Android.Content.Intent, System.Int32) to get itself prepared. The activity may pop up a dialog to require user action, and the result will come back via its Android.App.Activity.OnActivityResult(int, Android.App.Result, Android.App.Result). If the result is Android.App.Activity.RESULT_OK, the application becomes prepared and is granted to use other methods in this class.

Only one application can be granted at the same time. The right is revoked when another application is granted. The application losing the right will be notified via its VpnService.OnRevoke. Unless it becomes prepared again, subsequent calls to other methods in this class will fail.

The user may disable the VPN at any time while it is activated, in which case this method will return an intent the next time it is executed to obtain the user's consent again.

[Android Documentation]

Requirements

Namespace: Android.Net
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 14