Razgriz
Razgriz

Reputation: 7343

QR Code Scanner w/ZXing error

I have this simple code that plans to Scan a QR Code and return the value to the user:

public class QRCodeScanner extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
}

private static final int REQUEST_BARCODE;

Intent intent = new Intent("com.google.zxing.client.android.SCAN");
intent.putExtra("SCAN_MODE", "QR_CODE_MODE");  
startActivityForResult(intent, REQUEST_BARCODE);

Toast toast = Toast.makeText(this, "Start scanning QR code", Toast.LENGTH_SHORT);
toast.show();
}

Now I know that I need to place the src/com.google.zxing.client.* folders somewhere in this project but where? When I copy-paste it over at my own src/ folder they all have errors that weren't present in the original CaptureActivity project. How do I fix this?

Upvotes: 0

Views: 970

Answers (1)

Chris Thompson
Chris Thompson

Reputation: 35598

Actually, you don't. When you configure your application to use Zxing via Intent, the only requirement is that the barcode scanner be present and installed on the user's device. Android will handle opening the application and returning the scanned barcode to you.

Upvotes: 2

Related Questions