本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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();
}
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
}
示例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);
}
}
}