QR code reading with camera - Android

前端 未结 2 1531
失恋的感觉
失恋的感觉 2020-12-23 15:52

I am currently researching to build an alarm clock application in Android. I am utterly and completely new to programming with QR codes. I know nothing about it. But right n

相关标签:
2条回答
  • 2020-12-23 15:54

    In Android this requires about 10 minutes:

    https://github.com/zxing/zxing/wiki/Scanning-Via-Intent

    0 讨论(0)
  • 2020-12-23 15:54

    Just donwload the barcode Scanner (QR-Code Scanner) apk file.

    http://www.aapktop.com/tag/barcode-scanner-apk http://www.4shared.com/android/2lwrpeHZ/Barcode_Scanner.html http://code.google.com/p/zxing/downloads/detail?name=BarcodeScanner4.31.apk

    Install it your device (not on emulator).

    now follow these steps.

    1. create a new project
    2. place a button in your XML file.
    3. Make a click event for it and call the (QR-Code Scanner) via intent as

              // Scan Handler
      btnScan.setOnClickListener(new OnClickListener() {
      
          @Override
          public void onClick(View v) {
      
              Intent intent = new Intent(
                      "com.google.zxing.client.android.SCAN");
              intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
              startActivityForResult(intent, 0);
          }
      });
      
    4. Override the onActivityResult Method as

      // ZXing Result Handler
      
      public void onActivityResult(int requestCode, int resultCode, Intent intent) {
      
      if (requestCode == 0) {
          if (resultCode == RESULT_OK) {
      
      
                  contents = intent.getStringExtra("SCAN_RESULT"); // This will contain your scan result
                      String format = intent.getStringExtra("SCAN_RESULT_FORMAT");
      
      
          }
       }
      

    Q2

    Answer
    

    there are many links out there you can generate the QR-CODE of any type freely. just google it "Online QR CODE generater" http://qrcode.kaywa.com/

    0 讨论(0)
提交回复
热议问题