user3060845
user3060845

Reputation: 61

How to integrate ZXing to AndroidApp with Maven?

I'm writing an Android App and would like to include a QR-Code scanner to allow the Users the comfortable option of using these Codes without installing another App.

Because I'm building my Project with Maven I tried (as suggestet on the project site) to include the ZXing Barcodescanner with the folloing code inside the pom.xml

<dependency>
    <groupId>com.google.zxing</groupId>
    <artifactId>core</artifactId>
    <version>2.2</version>
</dependency>

Unfortunately it did not work (I can't start the Intent com.google.zxing.client.android.SCAN)

public void onButtonClick(View view) {
    try {
        Intent intent = new Intent("com.google.zxing.client.android.SCAN");
        intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
        startActivityForResult(intent, 0);
    } catch(Exception e) {
        e.printStackTrace();
        Toast.makeText(getApplicationContext(), "ERROR:"+e, 1).show();
    }
}

Does anyone got an idea how I can bring it alive? Or an alternative QR-Code Scanner?

-- Thank you

Upvotes: 2

Views: 2584

Answers (1)

Igor Konoplyanko
Igor Konoplyanko

Reputation: 9374

Add as dependency android-integration module:

<dependency>
    <groupId>com.google.zxing</groupId>
    <artifactId>android-integration</artifactId>
    <version>2.3.0</version>
</dependency>

Upvotes: 1

Related Questions