机器人开始从二维code与PARAMS应用机器人、code、PARAMS

由网友(暴力小青年i)分享简介:我想知道是否有可能在Android中使用QR code器来启动应用程序。我想实现的东西:I want to know if it's possible in android to start application using QR Code reader. The things that I want to ach...

我想知道是否有可能在Android中使用QR code器来启动应用程序。我想实现的东西:

I want to know if it's possible in android to start application using QR Code reader. The things that I want to achieve is :

创建QR code和扫描用QR code阅读器后,我要开始我的应用程序的一些参数,可以也许它会看起来是这样的:对myApp://org.hardartcore.myApp myParams?或者也可以是类似这样的,真的不知道。

I create QR Code and after scanning it with QR Code reader I need to start my application with some params, maybe it will looks something like this : myApp://org.hardartcore.myApp?myParams or maybe something similar to this, not really sure.

反正有没有做到这一点,并获得其在建的QR code,意图用于启动应用程序的参数。

Is there anyway to achieve this and to get the param which is build in the qr code with the intent for launching the application.

推荐答案

这个文本创建QR code:对myApp:// extraString 与任何阅读QR code读卡器。甚至你可以用 Zxing 的开源集成自己的QR code读卡器。你可以得到 extraString 作为@Sean欧文用提到 getIntent()。getDataString()。而且不要忘记添加这在你的manifest文件:

Create QR CODE with this text : myApp://extraString and read it with any qr code reader. Or even you can integrate your own qr code reader using Zxing's open source. And you can get the extraString as @Sean Owen mentioned using getIntent().getDataString(). And don't forget to add this in your manifest file :

<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="myApp"/>

这应该工作。

阅读全文

相关推荐

最新文章