Vikram
Vikram

Reputation: 1092

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?

Upvotes: 2

Views: 3835

Answers (2)

Maxim
Maxim

Reputation: 4234

If you still need a right solution then use DevicePolicyManager.setCameraDisabled().

Upvotes: 1

spartygw
spartygw

Reputation: 56

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.

Upvotes: 1

Related Questions