开发者

Android barcode reader [closed]

开发者_开发知识库 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 9 years ago.

i really want to know if there is a uri for calling via intent a generic barcode scanner, i don't want to limit the user to ZXing one.


There is no official Google-approved generic intent, but theoretically any app could register itself for the ZXing intent, as long as you don't explicitly set the package name.

In other words, ZXing's intent is:

Intent intent = new Intent("com.google.zxing.client.android.SCAN");
        intent.setPackage("com.google.zxing.client.android"); // This is explicit - leave off to let other apps match
        intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
        startActivityForResult(intent, 0);

If you leave off the line I commented (line 2), any app that registers itself as an IntentHandler for "com.google.zxing.client.android.SCAN" can handle the Intent. Whether any actually do (or whehther they handle the same range of extra options and return the same kinds of data) is a different issue, although it's listed on the OpenIntents site.


if there is a uri for calling via intent a generic barcode scanner

No, sorry, there is none.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜