public void ParseJsonFromHtml(Java.Lang.String message)
		{
			if (message != null && message.Length() > 0)
			{
				var json = JObject.Parse((string)message);
				var md = (string)json["MD"];
				var paRes = (string)json["PaRes"];

				jsonListener.Invoke(this, new CardVerificationResult { md = md, paRes = paRes });
			}
		}
Exemplo n.º 2
0
		/// <summary>
		/// Sends a message.
		/// </summary>
		/// <param name='message'>
		/// A string of text to send.
		/// </param>
		private void SendMessage (Java.Lang.String message)
		{
			// Check that we're actually connected before trying anything
			if (chatService.GetState () != BluetoothChatService.STATE_CONNECTED) {
				Toast.MakeText (this, Resource.String.not_connected, ToastLength.Short).Show ();
				return;
			}
	
			// Check that there's actually something to send
			if (message.Length () > 0) {
				// Get the message bytes and tell the BluetoothChatService to write
				byte[] send = message.GetBytes ();
				chatService.Write (send);
	
				// Reset out string buffer to zero and clear the edit text field
				outStringBuffer.SetLength (0);
				outEditText.Text = string.Empty;
			}
		}