Android Programming Press on the image to return to the main documentation page.

Administrator

List of types:

AdminManager

AdminManager

See this link for more information.

Events:

None

Members:


  Disable

  Enable (Explanation As String)

  Enabled As Boolean [read only]

  LockScreen

  MaximumTimeToLock As Long [write only]

  PASSWORD_QUALITY_ALPHABETIC As Int

  PASSWORD_QUALITY_ALPHANUMERIC As Int

  PASSWORD_QUALITY_NUMERIC As Int

  PASSWORD_QUALITY_UNSPECIFIED As Int

  PasswordSufficient As Boolean [read only]

  RequestNewPassword

  ResetPassword (NewPassword As String) As Boolean

  SetPasswordQuality (QualityFlag As Int, MinimumLength As Int)

Members description:

Disable
Disables the admin policy.
Enable (Explanation As String)
Enables the admin policy. The user will be shown a dialog with the requested features.
This method can only be called from an Activity context.
Explanation - A message shown at the top of the dialog.
Enabled As Boolean [read only]
Returns true if the admin policy is active.
LockScreen
Immediately locks the screen. Requires the force-lock tag in the policies file.
MaximumTimeToLock As Long [write only]
Sets the maximum time (measured in milliseconds) before the device locks.
This limits the length that the user can set in the settings screen.
Requires the force-lock tag in the policies file.
PASSWORD_QUALITY_ALPHABETIC As Int
PASSWORD_QUALITY_ALPHANUMERIC As Int
PASSWORD_QUALITY_NUMERIC As Int
PASSWORD_QUALITY_UNSPECIFIED As Int
PasswordSufficient As Boolean [read only]
Tests whether the current password meets the requirements.
Requires the limit-password tag in the policies file.
RequestNewPassword
Shows the new password activity. Note that the user might cancel the change.
ResetPassword (NewPassword As String) As Boolean
Sets the given password as the device password.
Requires the reset-password tag in the policies file.
SetPasswordQuality (QualityFlag As Int, MinimumLength As Int)
Sets the minimum allowed length and quality for device passwords.
These settings will affect new passwords.
Requires the limit-password tag in the policies file.

QualityFlag - One of the password quality flags.
MinimumLength - Password minimum length.

Example:
manager.SetPasswordQuality(manager.PASSWORD_QUALITY_ALPHANUMERIC, 4)

Top