本文整理匯總了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);
}