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


Java IntentIntegrator.setCameraId方法代码示例

本文整理汇总了Java中com.google.zxing.integration.android.IntentIntegrator.setCameraId方法的典型用法代码示例。如果您正苦于以下问题:Java IntentIntegrator.setCameraId方法的具体用法?Java IntentIntegrator.setCameraId怎么用?Java IntentIntegrator.setCameraId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.zxing.integration.android.IntentIntegrator的用法示例。


在下文中一共展示了IntentIntegrator.setCameraId方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: scanCode

import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void scanCode() {

    try {
        CameraManager manager = (CameraManager) getApplicationContext().getSystemService(Context.CAMERA_SERVICE);
        String[] cameraIds = manager.getCameraIdList();
        for (int i = 0; i < cameraIds.length; i++) {
            CameraCharacteristics characteristics = manager.getCameraCharacteristics(cameraIds[i]);
            if (characteristics.get(CameraCharacteristics.LENS_FACING) == CameraCharacteristics.LENS_FACING_BACK) {
                IntentIntegrator integrator = new IntentIntegrator(this);
                integrator.setCameraId(i);
                integrator.initiateScan();
            }
        }
    } catch (CameraAccessException e) {
    }

}
 
开发者ID:wcomartin,项目名称:PlexPy-Remote,代码行数:19,代码来源:ServerQRScannerActivity.java

示例2: zxingScan

import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
/**
 * This method handles the communication to the ZXING API -> Apache License 2.0
 * For more information please check out the link below.
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 */
public void zxingScan(){
    IntentIntegrator integrator = new IntentIntegrator(activity);
    integrator.setDesiredBarcodeFormats(IntentIntegrator.ALL_CODE_TYPES);
    integrator.setPrompt((String) getResources().getText(R.string.xzing_label));
    integrator.setCameraId(0);
    integrator.setBeepEnabled(false);
    integrator.setBarcodeImageEnabled(false);
    integrator.initiateScan();
}
 
开发者ID:Fr4gorSoftware,项目名称:SecScanQR,代码行数:16,代码来源:MainActivity.java

示例3: scan

import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
public void scan() {

        integrator = new IntentIntegrator(this);
        integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
        integrator.setCameraId(EssensbonUtils.getPreferredCamera());
        integrator.setOrientationLocked(true);
        integrator.setBeepEnabled(false);
        integrator.setCaptureActivity(ScanActivity.class);
        integrator.setPrompt("");
        integrator.initiateScan();

    }
 
开发者ID:LCA311,项目名称:leoapp-sources,代码行数:13,代码来源:EssensbonActivity.java

示例4: joinGame

import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
public void joinGame ()
{
    IntentIntegrator integrator = new IntentIntegrator(this);
    integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
    integrator.setPrompt("Scan");
    integrator.setCameraId(0);
    integrator.setBeepEnabled(false);
    integrator.initiateScan();
}
 
开发者ID:rhintersteininger,项目名称:open-wheels,代码行数:10,代码来源:LobbyActivity.java

示例5: scanQRCode

import com.google.zxing.integration.android.IntentIntegrator; //导入方法依赖的package包/类
public void scanQRCode(View v) {
    IntentIntegrator integrator = new IntentIntegrator(this);
    integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
    integrator.setOrientationLocked(true);
    integrator.setCameraId(0);
    integrator.setBeepEnabled(true);
    integrator.initiateScan();
}
 
开发者ID:pili-engineering,项目名称:PLDroidMediaStreaming,代码行数:9,代码来源:MainActivity.java


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