I'm using zxing in my app by Intent, like this:
private void launchScanner() {
Intent intent = new
Intent("com.google.zxing.client.android.SCAN");
try {
startActivityForResult(intent, REQUEST_CODE_SCANNER);
} catch (ActivityNotFoundException e) {
// ask the user, if he wants to install from market ...
}
}
If Barcode Scanner is not installed, the user is asked, if he wants to
install it. If he accpets, the market opens with Barcode Scanner
preselected. Calling Barcode Scanner via Intent and getting the result
works fine. I like this solution, because the apps are totally
decoupled and the user receives updates for Barcode Scanner
automatically. I as a developer don't have to care / update my app
each time Barcode Scanner gets updated.
Now Google Goggles comes in. I noticed, that Google Goggles reacts on
my Intent call, too. Though my call contains the fully qualified name.
So, if I have Barcode Scanner and Goggles installed, and launch the
scanner, I get a selection dialog with both apps. This is acceptable,
if you want to scan codes, which are supported by Goggles. In my case
I have interleaved 2/5, which Goggles doesn't seem to recognize. So
Googles isn't a real alternative to Barcode Scanner and shouldn't show
up in the selection.
So my question is, is there a way to make 100% sure, that only Barcode
Scanner is taken into account, when launching the scan process?
BR
Henrik
private void launchScanner() {
Intent intent = new Intent(BARCODE_SCANNER_PACKAGE + ".SCAN");
intent.setPackage(BARCODE_SCANNER_PACKAGE);
try {
startActivityForResult(intent, REQUEST_CODE_SCANNER);
} catch (ActivityNotFoundException e) {
// ask the user, if he wants to install from market ...
}
}
On 16 Dez., 14:48, Henrik Niehaus <henrik.nieh...@googlemail.com>
wrote: