Search code examples
androidnfcnfc-p2pandroid-beam

Using setNdefPushMessage in loop in Android


Can I send multiple NDEF messages using setNdefPushMessageCallback or setNdefPushMessage like in a loop from one activity in Android?


Solution

  • You can use those methods wherever and as often as you want within your activity's code. However, only the last message set before any peer-to-peer (Beam) communication will be transfered by Android. Messages that you previously set will simply be dropped.

    So you can only send one NDEF message over a peer-to-peer connection.