简体   繁体   English

Android应用程序和模式锁定屏幕

[英]Android App and Pattern Lock Screen

I am currently developing an app for android 2.2 or above. 我目前正在开发Android 2.2或更高版本的应用程序。

I want to allow the user to enable a login before having access to the app. 我想允许用户在访问应用程序之前启用登录。 I want to allow the user to choose between various types of login like password, pin or pattern. 我想允许用户在各种类型的登录之间进行选择,如密码,密码或模式。

I was wondering if would be possible to add a pattern lock to my own app. 我想知道是否可以在我自己的应用程序中添加模式锁定。 Is there a plugin I can use to create one or use android's pattern lock for my own app. 是否有一个插件我可以用来创建一个或使用Android的模式锁为我自己的应用程序。 I only want this for the app I don't want it to change how the actual device is locked. 我只希望这个应用程序我不希望它改变实际设备的锁定方式。

Thanks for any help you can provide. 感谢您的任何帮助,您可以提供。

I dont think there is a widget for this. 我不认为有一个小部件。 I would create a matrix of images 3x3 give them each a listener and keep track of the order the user presses them. 我会创建一个图像矩阵3x3给每个人一个听众,并跟踪用户按下它们的顺序。 Then take the order, 2,3,6,5,8 for example, save them as a string "23658" this is the password! 然后接受订单,例如2,3,6,5,8,将它们保存为字符串“23658”,这是密码! hash and save that somewhere. 哈希并保存在某处。 whenever a user inputs the button order compare the input hash to the saved one. 每当用户输入按钮顺序时,将输入散列与保存的散列进行比较。

如果有任何正在寻找答案,我发现这个库非常有用,并且比在GitHub上托管的android-lockpattern好多了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM