当前位置: 首页>>代码示例>>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;未经允许,请勿转载。