public void OnNdefPushComplete(NfcEvent e)
        {
            Intent intent = new Intent(this, typeof(MenuActivity));

            intent.PutExtra("status", "Attendance registerd");
            StartActivity(intent);
        }
示例#2
0
        public void OnNdefPushComplete(NfcEvent evt)
        {
            Padbook friendBook = pm.GetPadbookForUsername(contactName);

            friendBook.AppendPads(keys.ToArray());
            _Handler.ObtainMessage(MESSAGE_SENT).SendToTarget();
        }
        public NdefMessage CreateNdefMessage(NfcEvent e)
        {
            NdefRecord  txt     = NdefRecord.CreateTextRecord("token", token);
            NdefMessage message = new NdefMessage(new[] { txt });

            return(message);
        }
示例#4
0
        public NdefMessage CreateNdefMessage(NfcEvent e)
        {
            DateTime    time = DateTime.Now;
            string      text = code;
            NdefMessage msg  = new NdefMessage(new NdefRecord[] { CreateMimeRecord("sending code", Encoding.UTF8.GetBytes(text)) });

            return(msg);
        }
        public NdefMessage CreateNdefMessage(NfcEvent evt)
        {
            DateTime    time = DateTime.Now;
            var         text = _user.stripeToken;
            NdefMessage msg  = new NdefMessage(
                new NdefRecord[] { CreateMimeRecord(
                                       "application/nfc_app.nfc_app", Encoding.UTF8.GetBytes(text)) });

            return(msg);
        }
示例#6
0
 public void OnNdefPushComplete(NfcEvent e)
 {
     try
     {
         // 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();
     }
     catch (Exception exc)
     {
         Helpers.LoggerHelper.LogException(exc);
     }
 }
示例#7
0
        //NFC EVENTS
        public NdefMessage CreateNdefMessage(NfcEvent evt)
        {
            if (myName == null)
            {
                Identity.LoadUsername(GetExternalFilesDir(null).ToString());
                myName = Identity.Username;
            }
            string datagram = myName + ",";

            foreach (string e in keys)
            {
                datagram += e + "#";
            }
            NdefRecord mimeRec = new NdefRecord(
                NdefRecord.TnfMimeMedia, Encoding.UTF8.GetBytes(Mime),
                new byte[0], Encoding.UTF8.GetBytes(datagram));

            NdefMessage msg = new NdefMessage(new NdefRecord[] { mimeRec });

            return(msg);
        }
示例#8
0
        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);
        }
示例#9
0
        public NdefMessage CreateNdefMessage(NfcEvent e)
        {
            try
            {
                DateTime time = DateTime.Now;
                var      text = (Global.WriteMessage);

                if (string.IsNullOrEmpty(text))
                {
                    text = "Blank Message";
                }

                NdefMessage msg = new NdefMessage(
                    new NdefRecord[] { CreateMimeRecord(
                                           Helpers.ConstantsHelper.DataMimeType, Encoding.UTF8.GetBytes(text)) });
                return(msg);
            }
            catch (Exception exc)
            {
                Helpers.LoggerHelper.LogException(exc);
                return(null);
            }
        }
示例#10
0
 /// <summary>
 ///     Creates the ndef message.
 /// </summary>
 /// <param name="e">The e.</param>
 /// <returns>NdefMessage.</returns>
 public NdefMessage CreateNdefMessage(NfcEvent e)
 {
     InRange.Invoke <INfcDevice>(this, this);
     return(new NdefMessage(_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();
 }
示例#12
0
 public void OnNdefPushComplete(NfcEvent e)
 {
     SetBeamAktive(false);
     EnableBackground();
 }
示例#13
0
 public NdefMessage CreateMessage(NfcEvent e)
 {
     return(getTestMessage());
 }