Disabling screen switch off - android

We have a large fleet of android devices (Archos 70, running android 2.2) that we develop apps for to be used in the live events market.
One big problem we encounter is users touching the power key and turning the screen off, which generally they cannot find the key to turn them back on.
Is there any way in our flash air app that we can capture this key press and discard it?
Any help would be greatly appreciated!

No, actually this is impossible. This functionality is a part of Android. If you press power button everything is disabled. Even if you have wakelocks in your application they are all released when a user presses the power button. And I think that Google do not want to add such type of wakelock to their system because buggy applications can in this case block the ability to disable screen.

Related

Prevent hard switch off in smartphones using Kotlin

While most smartphones now require a PIN/password before we can switch it off, there are some ways to get around this.
For eg. I own a Samsung M30. If I'll press the Volume Down + Power button at the same time, the device will switch off.
I'm trying to develop an android app that lets the user temporarily disable the hard switch off. Is there a way to prevent this programmatically? Thanks!
No. This behaviour is enforced at a very low level. Even system apps can't modify this behaviour.

Android 4.4+ how to make a app become Screen Lock

I got a problem about how to create a simple Screen Lock for my Android devices (4.4.2)
I tried some ways, including disabling back, home and recent keys, but as far as I know, since android 4, I can't disable home and recent keys anymore due to security, so only back key is disabled.
I don't know what to do to handle this.
Any suggestions?
Please let me know.
Thank you in advanced

Prevent IME (Soft keyboard) from leaving the application

I want to prevent users from leaving the application (client requirement, not a mass public application).
But the IME allows the user to reach settings by pressing some touch. How can I block this without developing my own keyboard ?
As far as I understand from Google documentation, there is not much I can do because the IME is the first component to receive the screen inputs and it is the IME which decides what inputs my application receives.
Any pointer appreciated.
There's really no way to prevent somebody from being able to leave your app without a custom rom. However, Android 5.0 Lollipop allows device owners to pin the screen. For example, conferences that hand out tablets to their attendees are using the feature to restrict tablet usage to the conference app.
Here's a good write up to the feature:
http://www.androidpolice.com/2014/10/17/lollipop-feature-spotlight-screen-pinning-allows-you-to-lock-your-device-to-a-single-app-before-handing-it-to-a-friend/
Alternatively you could try one of the various launchers on the Play Store that use alternative locking strategies, but in my experience there's often a way around them unless they simply lock the device completely.

How to hold android device in dim-wakelock with disabled touchscreen?

I want to write an app that needs accelerometer data while the user has the device in his pocket. However, at least on my phone (Motorola Defy with a nightly CM9 build), a dim-wakelock is needed because the accelerometer somehow turns off together with the screen. But if the screen stays turned on, the user might trigger random touch actions with his body movements. I could just display a black area, but that won't protect the menu keys. So, what should I do to protect the device from accidential user interaction? Things that come to my mind:
use root access to somehow hook deep into the system and require an unlock pattern or so - but I as a user would hesitate to give an app root just because it wants to block my input, and if I as coder make a mistake, I might lock out users -> might work, but probably the worst possible solution
somehow use the lock screen for this - but I don't know how I can safely, whatever the settings on the device may be, activate that lock screen without needing root
Gah, this all just looks bad to me. Is there any way to solve this that doesn't suck?

Android lock screen

Is there a way to display text on lock screen? Like the information about unread SMS messages or like that Music Player on lock screen with Play/Pause buttons.
Thanks
Yes and no. Their is no public API to create or modify the lock screen. Whoever built the OS version on your device created your lock screen. Some of the manufacturers or carriers have added additional things to the lock screen. I've seen some that tie in to the music app, HTC sense has a somewhat customizable lock screen. So if you were willing to create your own rom and flash it to your device you could write your own lockscreen. Short of that the best you can do is write an app that the system thinks is an alternate home screen that has some kind of lock mechanism before the actual home is displayed. Then you set your device not to use a lock screen(so that it won't show both) This is not a great solution however, there are bound to be more ways to access the device if you use a "fake" lock screen like that so if security is an issue I wouldn't mess with it at all.
You might be able to find one of these "fake" lock screens on the market that suites your needs or you could create one that is exactly what you want. You could also search around on XDA for a rom that works with your device, 3rd party roms may be more likely to have the features your looking for on the lock screen.
If you end up making a pretend lock screen by using the home replacement method I strongly suggest you do not distribute something like that on the market. It is insecure and the users are unlikely to realize that there is a difference between that and a legit lock screen. Plus there is no guarantee that this method doesn't get broken at some point.

Categories

Resources