【问题标题】:How to receive MC40 barcode scanned data in Broadcast intent?如何在广播意图中接收 MC40 条码扫描数据?
【发布时间】:2015-03-25 07:31:49
【问题描述】:

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

我已创建 DataWedge 配置文件并将配置文件的意图输出插件配置为“意图传递 - 广播意图”

点击here获取指导。

【问题讨论】:

    标签: android broadcastreceiver barcode-scanner motorola motorola-emdk


    【解决方案1】:

    您可以在此Tutorial 中获得更好的运气,该Tutorial 解释了如何编写与 DataWedge 意图集成的 Android 原生应用程序。在这种特殊情况下是 StartActivity Intent。

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

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

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

    【讨论】:

      【解决方案2】:

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

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

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

      【讨论】:

        猜你喜欢
        • 2022-01-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多