Shiv
Shiv

Reputation: 129

Getting unexpected dialog message while using my barcode scanner app

I have made an app of Barcode Scanner using ZXing Classes And its all working fine except one thing, If my phone does not have ZXing Barcode Apk. Then it says Install Barcode Scanner? This Application requires Barcode Scanner. Would you like to install it?

So, My question is this, Is there any way that when I install my Project into my phone then that apk of ZXing Barcode Scanner also get automatically install or any way to include that apk into my project. I have included zxing-2.1.jar into libs folder. If is there any need of any line of my code then please let me know, I'll attach it.

I need help.

Thanks in Advance.

Upvotes: 1

Views: 342

Answers (4)

amir234
amir234

Reputation: 1

I think you must add your package name to IntentIntegrator

public static final List<String> TARGET_ALL_KNOWN = list(
          BS_PACKAGE, // Barcode Scanner
          BSPLUS_PACKAGE, // Barcode Scanner+
          BSPLUS_PACKAGE + ".simple", // Barcode Scanner+ Simple
          // What else supports this intent?
          // your package
          "x.y.z"

Upvotes: 0

K5 User
K5 User

Reputation: 636

This is a zxing lib feature, as if you look at their intent/activity start code, it checks for the app and pops up the "install app" message.

Look at:

  public final AlertDialog initiateScan(Collection<String> desiredBarcodeFormats)

in their code.

Upvotes: 0

Ashray Mehta
Ashray Mehta

Reputation: 375

I was facing the same issue a couple of months ago. You can keep the ZXing code as a library in your project but it isn't recommended, as the app's code may change (for better) but your copied library won't (automatically). The best thing to do would be to redirect the user to the Play Store page of the Barcode Scanner which would give them the option to install the app. This is also suggested by the ZXing team.

For more information you may refer to this link.

Upvotes: 1

Stefan Kienzl
Stefan Kienzl

Reputation: 21

you can include the zxing lib into your app (see here: Integrating the ZXing library directly into my Android application).

or you can also use another lib called ZBar (http://zbar.sourceforge.net/). I used this one and it is really easy to use.

Upvotes: 0

Related Questions