如何注册我的Andr​​oid应用程序来处理"类型" QR的code? [英] How can I register my application on Android to handle a "type" of QR Code ?

查看:137
本文介绍了如何注册我的Andr​​oid应用程序来处理"类型" QR的code?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Android内置的吧code扫描仪应用程序(根据,我认为,在zxing)读取QR codeS和发射数据到应用程序基于领先的文字。例如,BEGIN:VCAL可能会推出一款日历应用程序; HTTP:可能会启动一个浏览器

The built-in barcode scanner application on Android (based, I think, on zxing) reads QR Codes and launches that data into an application based on the leading text. For example, "BEGIN:VCAL" might launch a calendar application; "http:" might launch a browser.

我怎样才能注册我的应用程序,操作系统(或酒吧code应用程序)将调用QR code文字是一个特定的类型(即主角)?

How can I "register" my application so the OS (or the Barcode application) will call it for a specific type (i.e. leading characters) of QR Code text?

推荐答案

以上的评论大多是正确的。然而,应用程序并不在内部处理任何行动。最后,它触发了某种所有操作,如添加联系人,打开一个URL的意图,增加了日历事件。通过注册来处​​理的这些的意图,以正常的方式(AndroidManifest.xml中),您可以与Android注册来处理这些操作。

The comment above is mostly correct. However the app does not handle any actions internally. In the end it fires an Intent of some kind for all actions, such as adding a contact, opening a URL, adding a calendar event. By registering to handle those Intents, in the normal way (AndroidManifest.xml) you can register with Android to handle these actions.

如果它的东西很个性,也许定义为一个新的URL方案,如foobar的:/ ...。然后注册处理在AndroidManifest.xml中这样的URI来达到同样的效果。

If it's something very customized, maybe define a new URL scheme for it like "foobar:/...". Then register to handle such URIs in AndroidManifest.xml to get the same effect.

这篇关于如何注册我的Andr​​oid应用程序来处理"类型" QR的code?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆