0

My app needs to run 8-12 hours a day. It should only respond to (single) taps so the display is unnecessary.

At the moment I only dim the screen, but I wanted the app to be power efficient since it only needs to respond to taps.

Do you have any suggestions on how I can tackle this?

More details: I'm trying to take a picture then play a sound whenever someone tap the phone. Then I saw this video https://youtu.be/TYxIsABsB1g?t=452 that's why I wanted to know how to turn off the display.

  • 1
    Welcome to SO. Your question is very broad and it is unclear what you want to achieve and why. Please read about [how to ask a good question](https://stackoverflow.com/help/how-to-ask) and elaborate on the issue you're trying to solve. You may want to implement a long-running task or background service if your app doesn't need to be in the foreground, instead of relying on the display. However, first elaborate on the problem and then it may be easier to guide you. – Julian Jul 17 '23 at 13:47
  • First, if you find an android solution that isn't for Maui, manually translate it from java/kotlin to C#, and put it in `Platforms/Android` directory. Second, a foreground service might be part of the solution. Third, consider device-specific solutions. E.g. devices with pick-up-to-wake or face sensor might be helpful. – ToolmakerSteve Jul 17 '23 at 21:52
  • A foreground service seemed like the answer I'm looking for. I'll update if I figure out how to detect touch/taps with foreground service. https://stackoverflow.com/questions/21112375/detect-gesture-with-phone-sleeping/21112668#21112668 – Alberto Rivera Jul 18 '23 at 08:25
  • The hardware will release the touch events when the screen is locked, so you can't do that unless your app is system app. – Liyun Zhang - MSFT Jul 24 '23 at 06:14

0 Answers0