當前位置: 首頁>>代碼示例>>Java>>正文


Java IntentIntegrator.addExtra方法代碼示例

本文整理匯總了Java中com.google.zxing.integration.android.IntentIntegrator.addExtra方法的典型用法代碼示例。如果您正苦於以下問題:Java IntentIntegrator.addExtra方法的具體用法?Java IntentIntegrator.addExtra怎麽用?Java IntentIntegrator.addExtra使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.zxing.integration.android.IntentIntegrator的用法示例。


在下文中一共展示了IntentIntegrator.addExtra方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: scan

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
@OnClick(R.id.btn_qr_scan)
void scan() {
    IntentIntegrator integrator = new IntentIntegrator(AddSiteActivity.this);
    integrator.setCaptureActivity(MyCaptureActivity.class);
    integrator.setOrientationLocked(true);
    integrator.setPrompt("請掃描二維碼");
    integrator.addExtra("SCAN_WIDTH", 480);
    integrator.addExtra("SCAN_HEIGHT", 480);
    integrator.initiateScan(IntentIntegrator.QR_CODE_TYPES);
}
 
開發者ID:PureDark,項目名稱:H-Viewer,代碼行數:11,代碼來源:AddSiteActivity.java

示例2: takeQrCodePicture

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
public void takeQrCodePicture() {
    IntentIntegrator integrator = new IntentIntegrator(this);
    integrator.setCaptureActivity(MyCaptureActivity.class);
    integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
    integrator.setOrientationLocked(false);
    integrator.addExtra(Intents.Scan.BARCODE_IMAGE_ENABLED, true);
    integrator.initiateScan();
}
 
開發者ID:mirioeggmann,項目名稱:appquest-pedometer,代碼行數:9,代碼來源:WalkActivity.java

示例3: launchBarcodeReader

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
public void launchBarcodeReader( String promptMessage ) {
    /*
    Intent intent = new Intent("com.google.zxing.client.android.SCAN");
    intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
    intent.putExtra("SCAN_FORMATS", "DATA_MATRIX,QR_CODE,MAXICODE,PDF_417,AZTEC");
    intent.putExtra("PROMPT_MESSAGE", promptMessage );
    startActivityForResult(intent, QR_READER_ACTIVITY_REQUEST_CODE);
    */
    // Lifted from QRStream :D
    SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);
    IntentIntegrator integrator = new IntentIntegrator(this);
    integrator.addExtra("RESULT_DISPLAY_DURATION_MS", Long.valueOf(sharedPref.getString("scan_delay", "0"))); // Want to be instant
    integrator.addExtra("PROMPT_MESSAGE", promptMessage);
    integrator.addExtra("CHARACTER_SET", "ISO-8859-1"); // By default process as 8bit

    AlertDialog barcodeScannerPrompt
            = integrator.initiateScan(Arrays.asList("QR_CODE", "AZTEC", "DATA_MATRIX", "MAXICODE" ));
    if (barcodeScannerPrompt != null) {
        // If zxing not installed, then launch the install recommendation dialog in barcodeScannerPrompt.
        barcodeScannerPrompt.setButton(DialogInterface.BUTTON_NEGATIVE, null, new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                setResult(RESULT_CANCELED, getIntent());
                finish();
            }
        });
    }

}
 
開發者ID:mofosyne,項目名稱:tagdrop,代碼行數:30,代碼來源:Receive.java

示例4: onCreate

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    sharedPreferences = getApplicationContext().getSharedPreferences("biblio", Context.MODE_PRIVATE);

    IntentIntegrator integrator = new IntentIntegrator(this);
    integrator.addExtra("SCAN_MODE", "QR_CODE_MODE");
    integrator.initiateScan();
}
 
開發者ID:adelolmo,項目名稱:biblio,代碼行數:11,代碼來源:LinkActivity.java

示例5: scanSalt

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
private void scanSalt() {
    final IntentIntegrator qr = new IntentIntegrator(this);
    qr.addExtra(Intents.Scan.PROMPT_MESSAGE,
            getString(R.string.pref_scan_qr_code_to_load_zxing_message));
    qr.addExtra(Intents.Scan.SAVE_HISTORY, false);
    qr.initiateScan(IntentIntegrator.QR_CODE_TYPES);
}
 
開發者ID:pdudits,項目名稱:supergenpass-android,代碼行數:8,代碼來源:Preferences.java

示例6: generateSalt

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
private void generateSalt() {
    final IntentIntegrator qr = new IntentIntegrator(this);
    final SecureRandom sr = new SecureRandom();
    final byte[] salt = new byte[512];
    sr.nextBytes(salt);
    final String saltb64 = new String(Base64.encodeBase64(salt)).replaceAll("\\s", "");
    setSaltPref(saltb64);
    qr.addExtra(Intents.Encode.SHOW_CONTENTS, false);
    qr.shareText(saltb64);
}
 
開發者ID:pdudits,項目名稱:supergenpass-android,代碼行數:11,代碼來源:Preferences.java

示例7: generateSalt

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
private void generateSalt() {
    final IntentIntegrator qr = new IntentIntegrator(getActivity());
    final SecureRandom sr = new SecureRandom();
    final byte[] salt = new byte[SALT_SIZE_BYTES];
    sr.nextBytes(salt);
    final String saltb64 = PATTERN_WHITESPACE.matcher(new String(Base64.encodeBase64(salt)))
            .replaceAll("");
    ((Preferences) getFragmentManager().findFragmentById(R.id.preferences))
            .setSaltPref(saltb64);
    qr.addExtra("SHOW_CONTENTS", false);
    qr.shareText(saltb64);
}
 
開發者ID:xxv,項目名稱:SuperGenPass,代碼行數:13,代碼來源:Preferences.java

示例8: callScannerApp

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
private void callScannerApp() {
    IntentIntegrator integrator = new IntentIntegrator(this);
    integrator.addExtra("SCAN_MODE", "PRODUCT_MODE");
    integrator.initiateScan();
}
 
開發者ID:adelolmo,項目名稱:biblio,代碼行數:6,代碼來源:BiblioActivity.java

示例9: scanSalt

import com.google.zxing.integration.android.IntentIntegrator; //導入方法依賴的package包/類
public void scanSalt() {
    final IntentIntegrator qr = new IntentIntegrator(getActivity());
    qr.addExtra("PROMPT_MESSAGE", getString(R.string.pref_scan_qr_code_to_load_zxing_message));
    qr.addExtra("SAVE_HISTORY", false);
    qr.initiateScan(IntentIntegrator.QR_CODE_TYPES);
}
 
開發者ID:xxv,項目名稱:SuperGenPass,代碼行數:7,代碼來源:Preferences.java


注:本文中的com.google.zxing.integration.android.IntentIntegrator.addExtra方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。