2015-02-11 235 views
0

我送以下NFC记录光束到另一个设备:NdefRecord.createApplicationRecord()不开发人员之间的工作和释放签名

NdefRecord extRecord = new NdefRecord(
      NdefRecord.TNF_EXTERNAL_TYPE, new String("de.juwei.myapp:event").getBytes(), new byte[0], payload); 
    NdefMessage msg = new NdefMessage(
      new NdefRecord[] { extRecord 
        /** 
        * The Android Application Record (AAR) is commented out. When a device 
        * receives a push with an AAR in it, the application specified in the AAR 
        * is guaranteed to run. The AAR overrides the tag dispatch system. 
        * You can add it back in to guarantee that this 
        * activity starts when receiving a beamed message. For now, this code 
        * uses the tag dispatch system. 
        */ 
        ,NdefRecord.createApplicationRecord("de.juwei.myapp") 
      }); 
    return msg; 

发送设备使用开发者签名,接收设备是从官方商店已签名的应用

该应用程序正确启动(因为createApplicationRecord),但它没有接收数据。该意图似乎是空的...

如果我安装应用程序的开发人员签名到两个设备上,相同的代码工程wonderfull。另一方正在按预期收到数据。

为什么不同应用程序签名之间存在差异,我怎么能通过这个问题?

最好的问候, 克林斯曼

+0

更新:它看起来像另一个问题 - 如果我将签名的发布应用程序安装到两个设备上,它不再工作。只有当我在两个设备上使用调试apk时。 有人知道为什么这种行为是不同的? – Juwei 2015-02-11 15:23:15

回答

0

没关系......它总是程序员:我上传的错误(旧)APK签署了该设备。所以代码中没有任何变化,应用程序不能识别这个意图。多么容易的错误 - 花了我很多时间才找到那件简单的事情!

+0

如果你从一个变量中取回你的包名,这将永远不会发生。 – CQM 2015-02-11 15:38:32

+0

在最终代码中,程序包名称将来自应用程序getPackageName(),但此问题与程序包名称没有任何关系。 – Juwei 2015-02-17 15:47:37

相关问题