當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。