1

What I am trying to achieve over here is, I want to disable wi-fi, camera, mic and every possible tool of communication on the phone when my app gets launched.

I got code for disabling wifi, which works good http://androidsnips.blogspot.com/2010/09/turn-off-on-wifi-in-android-using-code.html

The other one is for disabling bluetooth How to enable/disable bluetooth programmatically in android

I am not getting anything related to camera, mic or any possible stuff.

I hope someone can help :)

Thanks very much in advance.

Community
  • 1
  • 1
Tejas J
  • 51
  • 2
  • 12
  • Why you want to disable all these? What is the purpose of using phone but more specifically your app? – Vinod Maurya Mar 02 '11 at 17:46
  • I was developing some security related application for demo, thats why it was required. – Tejas J Mar 11 '11 at 09:41
  • Trying to achieve samething, please let me know the possibility of disabling the Camera, if you got any solution please help me in this.Am not clear how to kill the process. Thanks in advance. – Anil Kumar Oct 06 '11 at 04:16

2 Answers2

1

The Camera class comes locked to your process when you access it for the first time, and there are methods lock() and unlock() - so that means that no other process could use that device while your app has the camera locked, I guess. I doubt there's a way of getting rid of microphone input due to the ability for you to interfere with calls if you had that device locked.

Tom Whittock
  • 4,081
  • 19
  • 24
  • Thanks very much Tom for the inputs, would it be possible for you to point me to any detailed doc or code ? – Tejas J Jan 12 '11 at 15:02
1

I have got work around for disabling camera.

From 2.2, we can kill the process (not recommended, but I had no choice), so what I did was, when my condition = true, I kill the process.

Other tricky thing would be, when your condition = true, pass an intent to go to HOME and finish the activity, this worked well too for me.

Tejas J
  • 51
  • 2
  • 12