is there a way to use Nearby to share text via NFC between 2 android device using kotlin

408 Views Asked by At

i'm new to kotlin and i need to develop an android app that can use NFC to transfer text data from device A to device B, i was thinking about using Android beam but then i found out it was deprecated and newer versions of android devices will probably not support it, but then i read they replaced it with nearby share API, so my question is can i use it to accomplish this task, or is there any better way to do so?.

Thanks in advance..

i tried to get to learn how android beam api works but this i found out it 's dpereacted and newer device won't be supporting it.

1

There are 1 best solutions below

0
Andrew On

You cannot use "Nearby" to share via NFC. "Nearby" is Bluetooth/Wifi Direct as they are much more suited to sending data.

If you still want to send very small amounts of data via NFC then you might be able to use Host Card Emulation (HCE)

See https://github.com/underwindfall/NFCAndroid for a working example.