As it's said in android developers blog:
By itself, the touch mode is something very easy to understand as it simply indicates whether the last user interaction was performed with the touch screen. For example, if you are using a G1 phone, selecting a widget with the trackball will take you out of touch mode; however, if you touch a button on the screen with your finger, you will enter touch mode. When the user is not in touch mode, we talk about the trackball mode, navigation mode or keyboard navigation...
But android is booting by default in touch mode. How can I switch device into keyboard navigation mode, or make it a default one?
I'm developing app for a specific device, so it's rooted and I can also modify firmware.
You can force an Android device in or out of touch mode using Instrumentation.setInTouchMode(boolean).
new Instrumentation().setInTouchMode(false);
Running this as part of a boot receiver would probably achieve what you are looking for.
Related
Both Android and iPhone:
With a screen overlay, can it be used to activate parts of the screen, thereby simulating user actions, activating the underlying action areas on the screen, i.e. scrolling?
I found this floating window library but that may do the trick on Android, wondering if anyone else has suggestions?
With a screen overlay, can it be used to activate parts of the screen, thereby simulating user actions, activating the underlying action areas on the screen, i.e. scrolling?
No, on Android. Faking input into other apps has significant security ramifications. On Android, accessibility services have some limited ability to do this sort of thing, which is why Google is starting to restrict their distribution. And, of course, on a rooted device you will have more options.
I'm making an slideshow app for device running Android. I want to disable notification shade and soft buttons swipe to prevent customers from accessing OS. I know that i can use TYPE_SYSTEM_OVERLAY flag, but it disables touch events, so this is not a solution. Is there are way to achieve what i want? Thanks!
Dedicated devices that should "disable notifications shade and soft buttons" aka kiosk mode, should use screen pinning or task locking. For information about implementation of kiosk mode read Dedicated devices overview and DevicePolicyManager.
I'm in need to stop entering safe mode on my nexus 7 tablet, because I implemented an Kiosk based application simply overriding home screen. Once default home screen changed to my custom home screen, user not allowed to take reboot device for safe mode. Is there any possibility to implement these feature without changing firmware OS.
Thanks in advance!
I am developing an android lock screen and need to disable the navigation bar. Using a launcher you can disable the home button and you can override the back button, but you cannot override the recents button. Is it possible to disable or clear the recents soft key temporarily?
Follow up question - has anyone been able to programmatically disable and enable the nav bar via root on jelly bean?
What about using lights out mode and overriding onSystemUiVisibilityChange while capturing the touch?
I have decompiled toddler lock - which implements this functionality, but it uses some hackery and the main activity is corrupted.
There is no way to this on a stock device. You'll have to customize the Android OS. Any 'hackery' you are seeing is likely to break with the next update. You can't really replace the system lock screen either.
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?
Using a Partial Wake Lock (will the screen react?)
Disable the screen in some way, but keep everything (including touch response) working?
Other?
Any suggestions on this?
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.
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.
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?