Android NFC姜饼到ICS NDEF推送不工作

Android NFC姜饼到ICS NDEF推送不工作,android,nfc,android-4.0-ice-cream-sandwich,android-2.3-gingerbread,Android,Nfc,Android 4.0 Ice Cream Sandwich,Android 2.3 Gingerbread,我目前正在编写一个应用程序,它使用NFC在两台设备之间发送文本。我有两部Nexus S手机,一部跑步库存冰激凌三明治和一部跑步姜饼2.3.6 程序将使用示例google代码正确形成的NDEF消息推送到前台等待拾取,该小代码片段如下: /** * Push an NDEF to the foreground with the given text. * @param message The text to be put in the message that will be pushed.

我目前正在编写一个应用程序,它使用NFC在两台设备之间发送文本。我有两部Nexus S手机,一部跑步库存冰激凌三明治和一部跑步姜饼2.3.6

程序将使用示例google代码正确形成的NDEF消息推送到前台等待拾取,该小代码片段如下:

/**
  * Push an NDEF to the foreground with the given text.
  * @param message The text to be put in the message that will be pushed.
  * 
  */
public void pushNDEFwithText(String text)
{
  NdefRecord ndefRec = createTextRecord(text, Locale.ENGLISH, true);
  NdefMessage message = new NdefMessage(new NdefRecord[]{ ndefRec });  
  nfcAdapter.enableForegroundNdefPush(this, message);
  Log.i("NDEF", "Pushed an NDEF message containing the text: "+text);
}
当我让Gingerbread Nexus将标签推到前台时,程序运行良好,ICS会很好地拾取标签,我目前正在使用NFCTagInfo读取它

问题是:当我让ICS Nexus将标签推到前面时,姜饼似乎没有把它捡起来。我想我遇到了一点问题,因为ICS使用SNEP,姜饼使用NPP,有没有办法强迫ICS使用NPP?或者如果有人认为这不是问题所在,那会是什么

注意。理想情况下,我只想使用ICS,但谷歌由于错误停止了它的广播,因为ICS更新破坏了Nexus上的USB调试,我不得不通过互联网安装测试应用程序,并通过查看设备上的日志进行调试,这并不理想,所以我只是为姜饼开发。这也是为什么我不能从ICS上传日志的原因,但这是当NDEF在ICS前台,Gingerbread接收到它不工作的地方时的Gingerbread日志:

01-30 16:09:59.343: D/NFC JNI(197): Discovered P2P Target  
01-30 16:09:59.343: D/NfcService(197): LLCP Activation message  
01-30 16:09:59.394: I/NFC JNI(197): LLCP Link activated (LTO=150, MIU=128, OPTION=0x00, WKS=0x01)  
01-30 16:09:59.414: D/NdefPushClient(197): LLCP connection up and running  
01-30 16:09:59.417: D/NdefPushClient(197): no tags set, bailing  
01-30 16:10:00.160: I/NFC JNI(197): LLCP Link deactivated  
01-30 16:10:00.160: D/NfcService(197): LLCP Link Deactivated message. Restart polling loop.  
01-30 16:10:00.230: D/NFC JNI(197): Discovered P2P Target  
01-30 16:10:00.230: D/NfcService(197): LLCP Activation message  
01-30 16:10:00.304: I/NFC JNI(197): LLCP Link activated (LTO=150, MIU=128, OPTION=0x00, WKS=0x01)  
01-30 16:10:00.320: D/NdefPushClient(197): LLCP connection up and running  
01-30 16:10:00.324: D/NdefPushClient(197): no tags set, bailing  
01-30 16:10:05.621: I/NFC JNI(197): LLCP Link deactivated  
在这里,它位于姜饼的前景,ICS接收到它,它确实起作用:

01-30 16:18:54.058: I/ActivityManager(109): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.terminal/.TerminalActivity bnds=[5,231][115,349] } from pid 200  
01-30 16:18:54.093: I/NDEF(1314): Pushed an NDEF message containing the text: This is an example message!  
01-30 16:18:54.175: V/RenderScript_jni(200): surfaceDestroyed  
01-30 16:18:54.445: I/ActivityManager(109): Displayed com.terminal/.TerminalActivity: +360ms  
01-30 16:18:57.015: D/NfcService(197): NFC-EE routing OFF  
01-30 16:18:57.023: D/NfcService(197): NFC-C discovery ON  
01-30 16:18:57.375: D/NFC JNI(197): Discovered P2P Target  
01-30 16:18:57.375: D/NfcService(197): LLCP Activation message  
01-30 16:18:57.425: I/NFC JNI(197): LLCP Link activated (LTO=150, MIU=128, OPTION=0x00, WKS=0x01)  
01-30 16:18:57.445: D/NdefPushClient(197): LLCP connection up and running  
01-30 16:18:57.445: D/NdefPushClient(197): sending foreground  
01-30 16:18:57.449: D/NdefPushClient(197): about to create socket  
01-30 16:18:57.464: D/NdefPushClient(197): about to connect to service com.android.npp  
01-30 16:18:58.398: D/NdefPushClient(197): about to send a 44 byte message  
01-30 16:18:58.398: D/NdefPushClient(197): about to send a 44 byte packet  
01-30 16:18:58.476: D/NdefPushClient(197): about to close  
01-30 16:19:03.812: I/NFC JNI(197): LLCP Link deactivated  
01-30 16:19:03.812: D/NfcService(197): LLCP Link Deactivated message. Restart polling loop.

你在用光束吗?我使用了nfcAdapter.setNdefPushMessageCallback来推送消息,它似乎工作正常。我已经能够把这个推给ACR122阅读器,我也能得到信息。我相信您已经看过开发人员教程,但我使用的示例位于底部:


你在用光束吗?我使用了nfcAdapter.setNdefPushMessageCallback来推送消息,它似乎工作正常。我已经能够把这个推给ACR122阅读器,我也能得到信息。我相信您已经看过开发人员教程,但我使用的示例位于底部:


我不认为我有梁转向,我已经'解决'它通过另一个ICS电话。我不认为我有梁转向,我'解决'它通过另一个ICS电话。