How can i lock the android device with a password programmatically

前端 未结 2 1395
名媛妹妹
名媛妹妹 2020-12-29 17:13

I\'m trying to create an application that allow the user to lock his android device with a password from a website. So i must find a method to lock the device programmatical

2条回答
  •  时光说笑
    2020-12-29 18:12

    check of DevicePolicyManager, http://developer.android.com/reference/android/app/admin/DevicePolicyManager.html

    specifically, the resetPassword, and lockNow() methods.

    please read the entire device admin tutorial to understand how to use DPM in context, http://developer.android.com/guide/topics/admin/device-admin.html

    as for locking from the website. android c2dm is the preferred way to get push messages to the device. http://code.google.com/android/c2dm/

    note however that this is intended for occasional "wake up" messages, not for any sort of 2-way communication between the device and some other entity.

提交回复
热议问题