Broadcast intent中如何接收MC40条码扫描数据?

How to receive MC40 barcode scanned data in Broadcast intent?

我正在为 MC40 摩托罗拉 Android 设备制作应用程序,但我无法在 BroadcastReceiver 中接收 MC40 条码扫描数据?

我已经创建了 DataWedge 配置文件并将配置文件的意图输出插件配置为 "Intent delivery - Broadcast intent"

单击 here 获取指南。

确保您在 Datawedge 配置文件和应用程序的 AndroidManifest.xml 文件中都有正确的意图操作和类别设置。

您链接的文档中的示例将包含在您的 AndroidManifest.xml 中。

<intent-filter>
        <action android:name="android.intent.action.DEFAULT" />
        <category android:name="android.intent.category.MAIN" />
</intent-filter>

阅读此 Tutorial 后,您会有更好的运气,它解释了如何编写 Android 与 DataWedge 意图集成的本机应用程序。在这种特殊情况下,StartActivity Intent。

您想要添加到您的清单以拦截来自 DataWedge 的意图的意图过滤器实际上取决于您在 DataWedge 中设置配置文件的方式。按照教程,您将需要一些东西:

        <intent-filter>    
            <action android:name="com.motorolasolutions.emdk.sample.dwdemosample.RECVR"/>    
            <category android:name="android.intent.category.DEFAULT"/>    
        </intent-filter>   

如果您想使用 Broadcast Intent,您需要在应用程序中实现广播接收器,如 this tutorial 中所述。