通过触摸而不是电源按钮激活 Android

发布于 11-14 13:07 字数 206 浏览 6 评论 0原文

我们有一个平板电脑应用程序,我们希望在一段时间后对其进行屏幕超时,但希望用户通过触摸屏幕而不是设备侧面的“电源”按钮来重新启用它。

对此的最佳方法(电池性能)是什么?

  1. 使用部分唤醒锁定(屏幕会做出反应吗?)
  2. 以某种方式禁用屏幕,但保持一切(包括触摸响应)正常工作?
  3. 其他?

对此有何建议?

We've got a tablet application for which we want to screen to timeout after a certain period, but would like the user to re-enable it by touching the screen instead of the 'power'-button on the side of the device.

What's the best approach (battery performance) to this?

  1. Using a Partial Wake Lock (will the screen react?)
  2. Disable the screen in some way, but keep everything (including touch response) working?
  3. Other?

Any suggestions on this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

猫卆2024-11-21 13:07:36

加布里埃尔,

由于完全关闭屏幕是不可能的,因此您可能只想使用唤醒锁并将屏幕调暗至最低设置作为“超时”。这样您仍然可以接受屏幕触摸事件并将其从该状态“唤醒”并恢复到之前的亮度。

Gabriel,

Since this isn't possible by completely turning the screen off, you may want to just want to use a wake lock and dim the screen to its lowest setting as your 'timeout'. This way you can still accept screen touch events and 'wake' it from this state and bring it back to its previous brightness.

梦晓ヶ微光ヅ倾城2024-11-21 13:07:36

我们有一个平板电脑应用程序,我们希望在一定时间后使其屏幕超时,但希望用户通过触摸屏幕而不是侧面的“电源”按钮来重新启用它设备。

除非通过定制固件,否则这是不可能的。如果屏幕关闭,则不会响应触摸事件。

We've got a tablet application for which we want to screen to timeout after a certain period, but would like the user to re-enable it by touching the screen instead of the 'power'-button on the side of the device.

This is impossible except perhaps via custom firmware. If the screen is off, it will not respond to touch events.

娜些时光,永不杰束2024-11-21 13:07:36

您可以做的另一件事是使用应用程序关闭屏幕,例如 ScreenStandby,因为它在后台工作并且也可以在启动时启动。

出于好奇,我们如何联系某人来帮助创建自定义固件,就像您为 Gabriel 所做的那样?

Another thing you could do is use an app to turn screen off like ScreenStandby since it works in the background and can start on boot as well.

Out of curiosity, how can we go about contacting someone to help in creating a custom firmware like you did Gabriel?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文