简体   繁体   English

如何为Android制作解锁屏幕应用

[英]How to make unlock screen app for Android

I am trying to develop unlock screen app for Android. 我正在尝试为Android开发解锁屏幕应用程序。 I have downloaded some unlock screen app and tested. 我已经下载了一些解锁屏幕应用并进行了测试 I finally found one app. 我终于找到了一个应用程序 That is Fingerprint Screensaver . 那是指纹屏幕保护程序 It is what I exactly want. 这正是我想要的。 I mean I wish to replace the pattern unlock screen app. 我的意思是我希望更换模式解锁屏幕应用程序。 I am wandering how to replace the Android pattern unlock screen app. 我在徘徊如何更换Android模式解锁屏幕应用程序。

I have googled a lot, but I could not find how to do it. 我google了很多,但我找不到怎么做。 Somebody wrote it is a hack. 有人写道,这是一个黑客。 Even the Android does not support, I strongly wish to know how to do that. 即使Android不支持,我也非常希望知道如何做到这一点。

If someone knows about it, please give me a clue. 如果有人知道,请给我一个线索。 Thanks in advance a lot. 在此先感谢您。

Thanks. 谢谢。

You can create a custom unlock screen by adding the following intent filter to the AndroidManifest.xml file for your Activity: 您可以通过将以下intent过滤器添加到Activity的AndroidManifest.xml文件来创建自定义解锁屏幕:

<intent-filter>
  <action android:name="android.intent.action.MAIN" />
  <category android:name="android.intent.category.HOME" />
  <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

This is a hack because a dialog box will pop up asking the user which one he wants to use (yours or the default). 这是一个黑客,因为会弹出一个对话框询问用户他想要使用哪一个(你的或默认)。 Worse, if the user accidentally selects your lock screen as the default home screen in the chooser, they could seriously mess up their device. 更糟糕的是,如果用户不小心选择了锁定屏幕作为选择器中的默认主屏幕,他们可能会严重搞乱他们的设备。 They might end up having to do a factory reset. 他们可能最终不得不重置工厂。

The only safe way to create a custom lockscreen is to modify the Android platform itself. 创建自定义锁屏的唯一安全方法是修改Android平台本身。 This is how OEM skins like HTC Sense or Motoblur create custom lock screens. 这就是HTC Sense或Motoblur等OEM皮肤创建自定义锁屏的方式。

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

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