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