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().
Related
I'm working on a new flutter app and the client wants to detect screen mirroring and disable it, Is there is a way to do so in Flutter using a third party package or something?
I've tried using the FLAG_SECURE in android but it disables only screenshots not screen mirroring.
There is no out of the box package for flutter. And there is also no effective way to disable mirroring for Android and iOS.
What you can do on Android is to use the DisplayManager to get all current logical displays with the method getDisplays. Then you can maybe show a pop up if the number of displays is to big for your app, in order to inform the user.
For iOS I don't think there is something available to stop or at least detect screen mirroring.
for android side we can use
int CanMirror = Settings.Secure.getInt(this.getContentResolver(), Settings.Global.DEVELOPMENT_SETTINGS_ENABLED , 0);
you can get better idea :https://stackoverflow.com/a/63971764/18340828
and ios side dont have much idea.
I want to prevent remote screen recording of my app using third party apps like Anydesk, Quicksuppport, Teamviewer etc.
I have used below flag for activity :
getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);
but the above flag doesn't work for all devices.
Any other work around for preventing remote screen recording?
The apps you mentioned are operating with either permission of CAPTURE_VIDEO_OUTPUT or CAPTURE_SECURE_VIDEO_OUTPUT. Unfortunately, if they own CAPTURE_SECURE_VIDEO_OUTPUT, then setting the FLAG_SECURE on your window has no effect from their viewpoint.
Sadly, I don't think there is a better (or more effective) way to achieve the desired behavior.
If you make your app a device administrator, then (on certain api levels) you will have the ability to disable screen capturing on the entire device, but setting this up is a lot of hassle, and it's probably not what you want to do in the first place.
As the title stated, I want to design simple application without interaction from the user. After installation it will block the camera. then start a timer to release it after some time.
I tried 2 options: device manager using set camera disabled method but I could not run the project because of some errors in the manifast.
now I'm trying just to create a camera object to reserve the camera from other applications. but still the native camera app was able to start the camera.
My question: is my method correct? or there are much simpler ways to do it.
device manager using set camera disabled method but I could not run the project because of some errors in the manifast.
Perhaps you should consider asking a separate Stack Overflow question where you explain what you tried and what specific problems you encountered. If by "device manager" you mean the device administration APIs, this is the proper way of implementing what you want.
is my method correct?
No.
I switched on the camera in settings and can see stuff on the preview
but the camera doesn't work, I thought it was my program that called the camera wrongly but the default camera app also doesn't work
I really don't want to go back to using eclipse's AVD!. TIA
I just encountered this problem and the solution here worked like a charm.
I use genymotion as well, its great:D make sure no other apps are trying to access your camera. Also if you have a firewall make sure its not blocking access to the camera. If you have a camera on your computer you could try to switch the front or back camera option in genymotion to your computers camera instead of dummy camera. As a last result try to Create another emulator.
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