Locking the camera in android - android

Please help, i need a suggestion.
I am going to keep a button in my app. Which must lock the camera. The camera(hardware) must not to be used by any of the other camera applications. It should only unlock wen i press unlock button in my app.
and also a small doubt wat does "camera.lock();"

Use DeviceAdmin and set camera as disabled on pressing button you could enable it .Check here

Related

Lock screen on iOS and Android

I'm building my app with Phonegap. What I want to do is create a button on the screen and add a lock-screen event onclick. I searches on other posts but everyone tries to check if the screen is locked and execute then or before something. I only need the event (lock screen) to happen when clicking that button. It's exactly like you would lock it from the physical button on the iPhone but only it happens by clicking a button.
I need it both for iOS and Android but if you could give me a hint for only one, is welcomed.
Thank you!
For Android side;
As far as i know you app need to be registered on the device as an admin app. Then you can use the Device Administration API to lock the screen by DevicePolicyManager.lockNow()

FLAG_KEEP_SCREEN_ON does not work during keygaurd lock

Hi I am an Android newbie, I want to create an app which stays displayed even if the power button is pressed, I used,
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
but I had to press power button again to display the app, someone suggested me to use,
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
but it doesn't seem to work. Is there any work around ?
You can't prevent hardware keys overriding. Power button works on hardware level. Ur app will be unable to turn screen on after it was turned off by hardware.

How to set lock screen image through code?

Want to set a my app image on Lock screen of device when user is using the app and presses the lock button. And want to change it back to default when he quits the app.
Is This possible to do? Please suggest?
You are welcome to create an app widget that the user can elect to add to their lockscreen on Android 4.2 and higher.

Android: Camera App Crushed because camera being accessed too many times

I have a camera app that takes pictures when user clicks a button. Every time when user clicks the button I will disable the button and then enable the button after the picture has been saved to the phone.
This enable and disable stuff is done to prevent user striking the button crazily and destroy the app. However, it seems like it is not working as I expected. Any suggestion why this is happening? I am guessing multiple threads are trying to enable and disable the button at the same time, but I am not 100% sure.
It turns out that it was a concurrency problem. And I solved this by using ReaderWriterLockSlim to enable and disable the button which have solved problem (I was developing in Monodroid).

How to enable and disable the camera using the Android SDK?

I want to create a security application in which I want to disable the mobile camera when some event occurs.
As the user, I can disable the camera by going into settings. Can we do same thing in using code?
You could write code that opens all cameras and doesn't release them. As long as your app is running the camera won't be available to other apps, including the default camera picture taking thingamajig.
If you still need a right solution then use DevicePolicyManager.setCameraDisabled().

Categories

Resources