public NdefMessage CreateNdefMessage (NfcEvent evt) { DateTime time = DateTime.Now; var text = ("Beam me up!\n\n" + "Beam Time: " + time.ToString ("HH:mm:ss")); NdefMessage msg = new NdefMessage ( new NdefRecord[] { CreateMimeRecord ( "application/com.example.android.beam", Encoding.UTF8.GetBytes (text)) /** * The Android Application Record (AAR) is commented out. When a device * receives a push with an AAR in it, the application specified in the AAR * is guaranteed to run. The AAR overrides the tag dispatch system. * You can add it back in to guarantee that this * activity starts when receiving a beamed message. For now, this code * uses the tag dispatch system. */ //,NdefRecord.CreateApplicationRecord("com.example.android.beam") }); return msg; }
public NdefMessage CreateNdefMessage(NfcEvent e) { this.inRange.Invoke<INfcDevice>(this, this); return new NdefMessage(this.published.Values.ToArray()); }
public void OnNdefPushComplete (NfcEvent arg0) { // A handler is needed to send messages to the activity when this // callback occurs, because it happens from a binder thread mHandler.ObtainMessage (MESSAGE_SENT).SendToTarget (); }