Blame view

footsafety/app/src/main/java/etelligens/com/foodsafety/utils/CommonUtil.java 823 Bytes
f7a13682   “wangming”   项目初始化
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
  package etelligens.com.foodsafety.utils;
  
  import android.hardware.Camera;
  
  /**
   * @className: CommonUtil
   * @classDescription: 通用工具类  扫描二维码引入
   * @author: miao
   * @createTime: 2017210
   */
  public class CommonUtil {
  
      /**
       * @author miao
       * @createTime 2017210
       * @lastModify 2017210
       * @param
       * @return
       */
      public static boolean isCameraCanUse() {
              boolean canUse = true;
              Camera mCamera = null;
              try {
                  mCamera = Camera.open();
              } catch (Exception e) {
                  canUse = false;
              }
              if (canUse) {
                  if (mCamera != null)
                      mCamera.release();
                  mCamera = null;
              }
              return canUse;
      }
  }