title: Get device camera status in android?
body: <p>I want to create service in which I can get camera is opened or not.
  If there is camera already open I want to capture photo using camera.</p>
  
  <p>Please help me to do this.</p>
  
  <p>I tried following for get status but in that I always get STATUS_ON.</p>
  
  <pre><code>Camera _camera;
  boolean qOpened = false;
  try {
      _camera=Camera.open();
      qOpened=(_camera!=null);
      if(qOpened){
          Camera_status = "STATUS_OFF";
      }else{
          System.out.println("==nothing to do====");
      }
  
  } catch (Exception e) {
      Camera_status = "STATUS_ON";
      System.out.println("=====Camera running=====");
  }
  </code></pre>