i'm using 2 Galaxy S3 and i send a message from one to the other. I want the other to send back a response like "received msg" i'm using the android beam demo, and i want to add this ack.I send the ack message when i treat the first message in ProcessIntent with a simple "sendNdefMessage"? how do i manage the receipt of the ack in the other device?
void processIntent(Intent intent) {
Parcelable[] rawMsgs = intent.getParcelableArrayExtra(
NfcAdapter.EXTRA_NDEF_MESSAGES);
// only one message sent during the beam
NdefMessage msg = (NdefMessage) rawMsgs[0];
// record 0 contains the MIME type, record 1 is the AAR, if present
mInfoText.setText(new String(msg.getRecords()[0].getPayload()));
//ack message
mNfcAdapter.setNdefPushMessageCallback(ackMsg, this);
}
Thanks a lot