1

in the official documentation in Apple Developer, I have found that the: NfcAdapter.CreateNdefMessageCallback interface is no longer supported since API level 29: https://developer.android.com/reference/android/nfc/NfcAdapter.CreateNdefMessageCallback

However there is no info provided how if it is still possible (and how) to send message p2p (using Android Beam) from one device to another.

We are using this technology in applicaton for our client (they were synchronising some data using NFC). The clients now bough new devices with API level 30 - and the function is no longer working.

Do you now any steps how to workaround this keep using NFC? Or do we have to use another technologies to sends json data (small text messages) p2p? Like wifi p2p or bluetooth p2p?

  • Unclear if you've seen: https://developers.google.com/nearby – Morrison Chang Nov 07 '22 at 19:48
  • That is actually a good API, but client can´t really on internet connection and since the internet connection is needed using this Nearby Messages API it won´t do the job for me. But thx anyway, I didn´t know about this. – Michal Lyga Nov 09 '22 at 07:51

1 Answers1

2

I believe that some people have had success with creating a Host Card Emulated (HCE) service on one device and then reading like a real Type4 Tag using enableReaderMode to read/write to it to transfer the data.

e.g. https://github.com/underwindfall/NFCAndroid

Andrew
  • 8,198
  • 2
  • 15
  • 35
  • This actually looks just like what I needed. I will study and test it furthermore and will leave a message here then. Thx for help! – Michal Lyga Nov 09 '22 at 07:53
  • Also some related questions: https://stackoverflow.com/questions/60505440/android-nfcadapter-deprecated https://stackoverflow.com/questions/60812818/how-to-transfer-plain-text-via-android-nfc – Michal Lyga Nov 09 '22 at 07:55
  • This was just what I needed. I recommend the provided links. I have achieved just what I wanted (even that it took me like 50 hrs of bloody trying, coding and studying docus and forums). I am out of time so I can't really make some example Xamarin.Forms C# solution now, but if anyone would have some problem implementing the underwindfall solution (there is basically almost everything you need) in Xamarin.Forms, just let me know, I can advice. – Michal Lyga Dec 12 '22 at 18:04