コード例 #1
0
        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();
        }
コード例 #3
0
        public NdefMessage CreateNdefMessage(NfcEvent e)
        {
            NdefRecord  txt     = NdefRecord.CreateTextRecord("token", token);
            NdefMessage message = new NdefMessage(new[] { txt });

            return(message);
        }
コード例 #4
0
ファイル: MainActivity.cs プロジェクト: deezow756/NFC_Alarm
        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);
        }
コード例 #5
0
        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
ファイル: MainActivity.cs プロジェクト: RallyBus/NFCPOC
 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
ファイル: MainActivity.cs プロジェクト: RallyBus/NFCPOC
        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()));
 }
コード例 #11
0
 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
ファイル: MainActivity.cs プロジェクト: deezow756/NFC_Alarm
 public void OnNdefPushComplete(NfcEvent e)
 {
     SetBeamAktive(false);
     EnableBackground();
 }
コード例 #13
0
ファイル: DexService.cs プロジェクト: FredMorinGit/TestBE
 public NdefMessage CreateMessage(NfcEvent e)
 {
     return(getTestMessage());
 }