当前位置: 首页>>代码示例>>Java>>正文


Java CameraManager类代码示例

本文整理汇总了Java中com.google.zxing.client.android.camera.CameraManager的典型用法代码示例。如果您正苦于以下问题:Java CameraManager类的具体用法?Java CameraManager怎么用?Java CameraManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


CameraManager类属于com.google.zxing.client.android.camera包,在下文中一共展示了CameraManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CaptureActivityHandler

import com.google.zxing.client.android.camera.CameraManager; //导入依赖的package包/类
CaptureActivityHandler(CaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       Map<DecodeHintType,?> baseHints,
                       String characterSet,
                       CameraManager cameraManager) {
  this.activity = activity;
  decodeThread = new DecodeThread(activity, decodeFormats, baseHints, characterSet,
      new ViewfinderResultPointCallback(activity.getViewfinderView()));
  decodeThread.start();
  state = State.SUCCESS;

  // Start ourselves capturing previews and decoding.
  this.cameraManager = cameraManager;
  cameraManager.startPreview();
  restartPreviewAndDecode();
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:17,代码来源:CaptureActivityHandler.java

示例2: onResume

import com.google.zxing.client.android.camera.CameraManager; //导入依赖的package包/类
public void onResume() {
    cameraManager = new CameraManager(activity.getApplication());

    handler = null;

    if (hasSurface) {
        // The activity was paused but not stopped, so the surface still exists. Therefore
        // surfaceCreated() won't be called, so init the camera here.
        surfaceChanged(capturePreview.getHolder());
    } else {
        // Install the callback and wait for surfaceCreated() to init the camera.
        capturePreview.getHolder().addCallback((SurfaceHolder.Callback) activity);
    }

    mInactivityTimer.onResume();
}
 
开发者ID:snice,项目名称:androidscan,代码行数:17,代码来源:ScanHelper.java

示例3: BarcodeReaderHandler

import com.google.zxing.client.android.camera.CameraManager; //导入依赖的package包/类
BarcodeReaderHandler(BarcodeReaderView barcodeReaderView,
                     Collection<BarcodeFormat> decodeFormats,
                     Map<DecodeHintType, ?> baseHints,
                     String characterSet,
                     ResultPointCallback resultPointCallback,
                     CameraManager cameraManager) {
    this.barcodeReaderView = barcodeReaderView;
    decodeThread = new DecodeThread(barcodeReaderView, decodeFormats, baseHints, characterSet, resultPointCallback);
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
 
开发者ID:CoderChoy,项目名称:BarcodeReaderView,代码行数:17,代码来源:BarcodeReaderHandler.java

示例4: onResume

import com.google.zxing.client.android.camera.CameraManager; //导入依赖的package包/类
/**
 * 启动相机预览与扫描,在Activity/Fragment的onResume方法中调用。
 */
public void onResume() {
    if (checkCameraHardware()) {
        mCameraManager = new CameraManager(this);
        if (frameWidth > 0 && frameHeight > 0) {
            mCameraManager.setManualFramingRect(frameWidth, frameHeight, frameTopOffset);
        }
        SurfaceHolder surfaceHolder = getHolder();
        if (hasSurface) {
            initCamera(surfaceHolder);
        } else {
            surfaceHolder.addCallback(this);
        }
    } else {
        if (mOnBarcodeReadListener != null) {
            mOnBarcodeReadListener.onCameraNotFound();
        }
    }
}
 
开发者ID:CoderChoy,项目名称:BarcodeReaderView,代码行数:22,代码来源:BarcodeReaderView.java

示例5: CaptureActivityHandler

import com.google.zxing.client.android.camera.CameraManager; //导入依赖的package包/类
CaptureActivityHandler(CaptureActivity activity,
        Collection<BarcodeFormat> decodeFormats,
        Map<DecodeHintType, ?> baseHints, String characterSet,
        CameraManager cameraManager) {
    this.activity = activity;
    decodeThread = new DecodeThread(activity, decodeFormats, baseHints,
            characterSet, new ViewfinderView.ViewfinderResultPointCallback(
                    activity.getViewfinderView()));
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
 
开发者ID:chenkel,项目名称:Lokalisierung-mit-Wearables,代码行数:17,代码来源:CaptureActivityHandler.java

示例6: CaptureActivityHandler

import com.google.zxing.client.android.camera.CameraManager; //导入依赖的package包/类
CaptureActivityHandler(CaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       Map<DecodeHintType, ?> baseHints,
                       String characterSet,
                       CameraManager cameraManager) {
    this.activity = activity;
    decodeThread = new DecodeThread(activity, decodeFormats, baseHints, characterSet,
            new ViewfinderResultPointCallback(activity.getViewfinderView()));
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
 
开发者ID:yingLanNull,项目名称:ZxingLite,代码行数:17,代码来源:CaptureActivityHandler.java

示例7: CaptureActivityHandler

import com.google.zxing.client.android.camera.CameraManager; //导入依赖的package包/类
CaptureActivityHandler(CaptureActivity activity,
                        Collection<BarcodeFormat> decodeFormats,
                        String characterSet,
                        CameraManager cameraManager) {
fakeR = new FakeR(activity);
   this.activity = activity;
   decodeThread = new DecodeThread(activity, decodeFormats, characterSet,
       new ViewfinderResultPointCallback(activity.getViewfinderView()));
   decodeThread.start();
   state = State.SUCCESS;

   // Start ourselves capturing previews and decoding.
   this.cameraManager = cameraManager;
   cameraManager.startPreview();
   restartPreviewAndDecode();
 }
 
开发者ID:atomsheep,项目名称:sres-app,代码行数:17,代码来源:CaptureActivityHandler.java

示例8: CaptureActivityHandler

import com.google.zxing.client.android.camera.CameraManager; //导入依赖的package包/类
CaptureActivityHandler(CaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       Map<DecodeHintType, ?> baseHints, String characterSet,
                       CameraManager cameraManager) {
    this.activity = activity;
    decodeThread = new DecodeThread(activity, decodeFormats, baseHints,
            characterSet, new ViewfinderResultPointCallback(
            activity.getViewfinderView()));
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
 
开发者ID:raahilshah,项目名称:ProjectKilo,代码行数:17,代码来源:CaptureActivityHandler.java

示例9: CaptureFragmentHandler

import com.google.zxing.client.android.camera.CameraManager; //导入依赖的package包/类
public CaptureFragmentHandler(BarcodeFragment activity,
                              Collection<BarcodeFormat> decodeFormats,
                              Map<DecodeHintType, ?> baseHints,
                              String characterSet,
                              CameraManager cameraManager) {
  this.activity = activity;
  decodeThread = new DecodeThread(activity, decodeFormats, baseHints, characterSet,
      new ViewfinderResultPointCallback(activity.getViewfinderView()));
  decodeThread.start();
  state = State.SUCCESS;

  // Start ourselves capturing previews and decoding.
  this.cameraManager = cameraManager;
  cameraManager.startPreview();
  restartPreviewAndDecode();
}
 
开发者ID:bushidowallet,项目名称:bushido-android-app,代码行数:17,代码来源:CaptureFragmentHandler.java

示例10: CaptureActivityHandler

import com.google.zxing.client.android.camera.CameraManager; //导入依赖的package包/类
CaptureActivityHandler(CaptureActivity activity,
        Collection<BarcodeFormat> decodeFormats,
        Map<DecodeHintType, ?> baseHints, String characterSet,
        CameraManager cameraManager) {
    this.activity = activity;
    decodeThread = new DecodeThread(activity, decodeFormats, baseHints,
            characterSet, new ViewfinderResultPointCallback(
                    activity.getViewfinderView()));
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
 
开发者ID:corneliudascalu,项目名称:google-glass-share-barcode-bluetooth,代码行数:17,代码来源:CaptureActivityHandler.java

示例11: CaptureActivityHandler

import com.google.zxing.client.android.camera.CameraManager; //导入依赖的package包/类
public CaptureActivityHandler(CaptureActivity activity,
        Collection<BarcodeFormat> decodeFormats,
        Map<DecodeHintType, ?> baseHints, String characterSet,
        CameraManager cameraManager) {
    this.activity = activity;
    decodeThread = new DecodeThread(activity, decodeFormats, baseHints,
            characterSet, new ViewfinderResultPointCallback(
            activity.getViewfinderView()));
    decodeThread.start();
    state = State.SUCCESS;

    // Start ourselves capturing previews and decoding.
    this.cameraManager = cameraManager;
    cameraManager.startPreview();
    restartPreviewAndDecode();
}
 
开发者ID:pt2121,项目名称:NYC-Glass-Challenge-Oct2014,代码行数:17,代码来源:CaptureActivityHandler.java

示例12: CaptureActivityHandler

import com.google.zxing.client.android.camera.CameraManager; //导入依赖的package包/类
CaptureActivityHandler(CaptureActivity activity,
                       Collection<BarcodeFormat> decodeFormats,
                       String characterSet,
                       CameraManager cameraManager)
{
	this.activity = activity;
	decodeThread = new DecodeThread(activity, decodeFormats, characterSet,
			new ViewfinderResultPointCallback(activity.getViewfinderView()));
	decodeThread.start();
	state = State.SUCCESS;

	// Start ourselves capturing previews and decoding.
	this.cameraManager = cameraManager;
	cameraManager.startPreview();
	restartPreviewAndDecode();
}
 
开发者ID:Abolitionist-Project,项目名称:MediModo-Android,代码行数:17,代码来源:CaptureActivityHandler.java

示例13: onCreate

import com.google.zxing.client.android.camera.CameraManager; //导入依赖的package包/类
@Override
public void onCreate(Bundle icicle) {
  super.onCreate(icicle);

  Window window = getWindow();
  window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
  setContentView(R.layout.capture);

  CameraManager.init(getApplication());
  viewfinderView = (ViewfinderView) findViewById(R.id.viewfinder_view);
  resultView = findViewById(R.id.result_view);
  statusView = (TextView) findViewById(R.id.status_view);
  handler = null;
  lastResult = null;
  hasSurface = false;
  historyManager = new HistoryManager(this);
  historyManager.trimHistory();
  inactivityTimer = new InactivityTimer(this);
  beepManager = new BeepManager(this);

  // showHelpOnFirstLaunch();
}
 
开发者ID:saqimtiaz,项目名称:BibSearch,代码行数:23,代码来源:CaptureActivity.java

示例14: initCamera

import com.google.zxing.client.android.camera.CameraManager; //导入依赖的package包/类
private void initCamera(SurfaceHolder surfaceHolder) {
  try {
    CameraManager.get().openDriver(surfaceHolder);
    // Creating the handler starts the preview, which can also throw a RuntimeException.
    if (handler == null) {
      handler = new CaptureActivityHandler(this, decodeFormats, characterSet);
    }
  } catch (IOException ioe) {
    Log.w(TAG, ioe);
    displayFrameworkBugMessageAndExit();
  } catch (RuntimeException e) {
    // Barcode Scanner has seen crashes in the wild of this variety:
    // java.?lang.?RuntimeException: Fail to connect to camera service
    Log.w(TAG, "Unexpected error initializating camera", e);
    displayFrameworkBugMessageAndExit();
  }
}
 
开发者ID:saqimtiaz,项目名称:BibSearch,代码行数:18,代码来源:CaptureActivity.java

示例15: start

import com.google.zxing.client.android.camera.CameraManager; //导入依赖的package包/类
void start(CameraManager cameraManager) {
  this.cameraManager = cameraManager;
  SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
  if (FrontLightMode.readPref(sharedPrefs) == FrontLightMode.AUTO) {
    SensorManager sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
    lightSensor = sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);
    if (lightSensor != null) {
      sensorManager.registerListener(this, lightSensor, SensorManager.SENSOR_DELAY_NORMAL);
    }
  }
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:12,代码来源:AmbientLightManager.java


注:本文中的com.google.zxing.client.android.camera.CameraManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。