私は2つのGalaxyS3を使用しており、一方から他方にメッセージを送信します。もう一方に「receivedmsg」のような応答を返送してもらいたいのですが、Androidビームのデモを使用しており、このackを追加したいと思います。ProcessIntentの最初のメッセージを単純な「sendNdefMessage」で処理するときにackメッセージを送信します。 ?他のデバイスでのACKの受信を管理するにはどうすればよいですか?
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);
}
どうもありがとう