Science, asked by ankit38421, 1 year ago

Android: How to send data (a string value) to another device using NFC?

Answers

Answered by ayshafebin
0

2

down vote

favorite

1

I want to create a mini app just to read an NFC tag and later send to another device on Android. That part is done already and I can read the tag and I can print the string on a EditText. But I also want to send the text that I have read from that tag to another device with NFC. How can I do that?

//I have this code here when a tag is discovered...

@Override

protected void onNewIntent(Intent intent) {

   if (intent.getAction().equals(NfcAdapter.ACTION_TAG_DISCOVERED)) {

       String result = "";

       result = ByteArrayToHexString(intent.getByteArrayExtra(NfcAdapter.EXTRA_ID));

       myTag = result;

       txtTag.setText(myTag);


Similar questions