My application uses TTS (text-to-speech) Engine, and the conflict I am running into is that Accessibility Talkback settings override anything TTS tries to say. I would like to disable the phone's talkback option if using my application.
Is there some sort of permission to handle this? I have not been able to find anything.
I know it's late, but I had the same problem few days ago.
If you want to "ovverride" the TalkBack with your own TTS engine you can simply add:
android:importantForAccessibility = "no"
to each view inside your Layout.
Now you can call your TtsSpeak() method inside your Activity.
IMPORTANT: This does not turn off the TalkBack App, but it will allow you to have a little bit more control over your App.
That is not allowed unless the phone is rooted. The accessibility functions on the phone are not to be changed by a developer, as a blind person may need them to use the phone.
Lg P875: having tried out Accessibility mode, the phone locked me out from scrolling - thus unable access Availability facility to reverse process. Nothing in User manual.
By accident I found selecting Settings icon, tap twice followed by long push on same icon. The screen released and I was able to terminate Talkback key. All back to normal, no thanks to LG user manual
Related
With the new Android 12 operating system, the user now has the ability to completely disable microphone and camera usage from ALL apps. This is actually a good thing, letting users easily control privacy.
If an app starts and has permission to use the microphone and the camera AND the user has disabled all access to either of these hardware, Android 12 automatically pops up an alert asking the user to re-enable the microphone or camera, or to continue with the hardware disabled for the app.
Also, on creation, the app can simply check when starting to see if the needed hardware is enabled, and can also prompt the user further or handle the condition as the app sees fit.
But what if the user disables the microphone or camera while the app is running? I can't seem to find any interfaces for something like onMicrophoneEnabled() or even a Broadcast of such an event.
It's possible to check every time onResume() is called, but I was hoping there'd be a more elegant solution.
If anyone knows of something that my app can use to capture this when the user has made changes either way, please let me know.
After carefully reading the google docs (https://developer.android.com/training/permissions/explaining-access#toggles) on their implementation of the user enable/disable of the camera and microphone I discovered something very interesting:
Apps are explicitly forbidden from knowing if the user has done any of these actions. So of course there is no way to get notified of these changes: it is by design.
If the user turns off the camera this way, the app will still get a camera feed, but it will be black. Similarly the microphone will still work, but we'll get only silence. This is a feature--a way to ensure privacy.
The operating system will remind users that they have disabled the microphone or camera and provide a chance to re-enable the hardware, which is nice. But the app is completely in the dark (hehe).
Another way to think of it: Just like putting a piece of tape over your camera or your thumb over the microphone. Only this time it's done by the operating system. This way a spy program or some other nefarious software will still think it's working and not try to bypass or give up.
This also explains why testing during onResume() or onWindowFocusChanged() didn't work either. I was getting results that didn't align with the settings (they aligned with current permissions).
So to answer my question: There is no way to be notified. That is the point.
Sorry this will be a general question as I don't even know where to start.
What I want:
I have an app on androind (bonus if solution works on iOS) where the same app can present different views depending on if you are an end user or a technician. What I need is some SIMPLE method where the app at launch can read a variable. I have read a lot about shortcuts, Quick action, Environment variables, etc. etc. but I can't find anything that doesn't require as much programming as the app itself!
I can think of two approaches…
long press on Icon which gives the option to start in "advanced mode" by passing an argument to the app
some setting that can be read by the app at launch akin to an Environment variable in other OS
Can someone please send my in the right direction. Maybe there is a standard way of doing this I'm just not aware of?
Many thanks!
You could present the user with a dialog on first start. He can indicate his "role" either by choosing one, or by entering a password or enabling code.
Or, you can default the app behaviour to "user", and offer a menu option to "enable technician mode", which could then request a password or other code to enable this option.
Or, you can default the app behaviour to "user" and if the user performs a specific magic gesture (ie: swipe right, swipe left, swipe right) then the "technician" mode is enabled.
What I wanted to do is apparently not possible, so instead I worked around it by always starting the app in user mode and having a hidden button for techs. Of course a user could find it by mistake but if security becomes an issue I will have to add a tech login. For now this solution is acceptable.
It did require some rework to get the sequence right but it turned out to be the lesser evil.
I am working on an android app that should be used by students in some kind of practical test.
I am using the screen pinning that was introduced in Lollipop (startLockTask()), so when my app is launched the user needs to allow the locking.
I couldn't find a way to know when the user click ok for the locking and when he unlock the pinning? (The user can cancel the lock by holding both the Back and Recent buttons).
I am not looking for a way to know if the user currently in lock screen (getLockTaskModeState ()), i want to know if i have a way to handle the events of locking or unlocking.
I want that in the begining of the test i will be able to send information to my server if the users 'logged in' properly (by allowing the lock), and as well if the user unlock the device before the end of the test.
EDIT
Hey, people!
Please explain yourselves after downvoting!
If I wasn't exaplaining myself - i will try again if you will let me know.
I read a lot of questions and answers about general lock screen, but not the one of app pinning, I also read about check the status of the current task- if it is locked or not, but i didn't find answer to what i am asking - is there a way to handle the event of unlocking the 'screen pinning' of a specific app.
So please, explain your downvotes!
Device Admin Recevier class give you the event of pinning and unpinning... However the example use the class when the installed app is provisioned for device owner.. Not sure if you could use it. You may refer to this too : How to be notified when screen pinning is turned off in Android 5.0 Lollipop?
https://developer.android.com/reference/android/app/ActivityManager.html#getLockTaskModeState()
Just use the function as stated in the link.
Since Android Lollipop, the user can hide notifications of an application from Android settings.
I'm writing a parental control application and I'm searching for a way to disable this functionality.
Indeed, I want notifications to be always displayed, even if the child doesn't want to see them.
I saw that on tablets (not on phones) we can create a specific profile to block access to the settings app, but I don't want to lock the settings app, and the trick needs to work on phones too.
I also looked in manifest file to see if an option was there to explicitly enable/disable this but I found nothing.
Please note that my app does have admin privileges.
After hours of head scratching and hundred of coffees, nothing came to me from Android developer website or any other website, I'm desparated.
So finally, is there a way to disable the possibility to hide notifications in Android Lollipop?
Disabling the ability to hide unwanted notification would be undoing what that feature is. As far as I know there is no way to do that.
EDIT:
However - there is an broadcast send after each settings change (WiFi turn on / off etc.). Some settings blocking apps are using this to revert changes made before entering password - maybe there is an intent that does the same for hiding notification.
My team is trying to build an Android application for a tablet that will be dedicated for this sole purpose. One of the requirements is that the application is the only thing running on the device (at least from the user's point of view). The user should not be able to close it or use any other functionality from the OS (settings, other apps, etc.).
We have been doing some research and so far have not found anything. Is this we are trying to do even possible ? Does anybody have any idea how we could approach this ? Maybe blocking the buttons ?
Thanks,
It is possible but would be ugly in the long run without a custom built rom (http://xda-developers.com has instructions on how to do this), I wouldn't know where to start code wise - but there are a couple of applications which portray this kind of functionality - TodlerLock is one such app - its designed to stop todlers from from doing anything on the device, whilst the application keeps them entertained. It appears to intercept all button presses and acts as a home application to do this for the home button.
Then there are the programs like estrongs security manager that allows a user to set a password for some or all applications and basically stops the application being run without the password (it appears to intercept the intents and opens the security manager requesting the password first, if it fails it finishes the intent) - this maybe a much easier option to use something like this - you could set a password for most things, including settings and the security application itself, everything bar your application. This will stop the user doing anything you dont want them doing without the password.
You would have to set up the device for the user before hand though, as any home screen intercepter application can be changed but the user - so you would have to set the default, then lock access to the settings so the user can't change this action.
I think the only way of doing this to have your own custom version of Android built only for you. Get the android source, remove what ever you don't want and build it. I am not sure if you would ever want not to close it but you can make sure they can't install anything else on your ROM.
Im not sure about this, but, intercept the home intent and write your own custom home?
It sounds a lot simpler than writing your own custom rom.
This is not possible without OS changes. You cannot override the home button.