Reputation: 2263
In my application, I want to check whether the user has set the password in their android device or not? I tried using device admin apis m not able to get those information. Is there any other way?
Upvotes: 2
Views: 3177
Reputation: 4731
Device administrator doesn't allow you to check whether device has lock screen password (or pattern ...) directly.
However you can do it indirectly.
DevicePolicyManager allows you to set/get required password quality level and check whether is password sufficient.
Your device admin will need to use limit-pasword policy:
<device-admin xmlns:android="http://schemas.android.com/apk/res/android">
<uses-policies>
<limit-password />
</uses-policies>
</device-admin>
And you should definetely read this Device Administrator Guide.
Upvotes: 1