예제 #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Create your application here
            SetContentView(Resource.Layout.Validate);
            SetTitle(Resource.String.ValidateActivity);

            var ValidateButton = FindViewById <Button>(Resource.Id.ValidateButton);
            var EmailText      = FindViewById <TextView>(Resource.Id.EmailText);
            var PasswordText   = FindViewById <TextView>(Resource.Id.PasswordText);
            var ResultTextView = FindViewById <TextView>(Resource.Id.ResultTextView);


            ValidateButton.Click += async(object sender, System.EventArgs e) => {
                SALLab06.ServiceClient ServiceClient = new SALLab06.ServiceClient();
                string StudentEmail = EmailText.Text;    //"*****@*****.**";
                string Pass         = PasswordText.Text; //"brisco10";
                string myDevice     = Android.Provider.Settings.Secure.GetString(ContentResolver, Android.Provider.Settings.Secure.AndroidId);

                SALLab06.ResultInfo result = await ServiceClient.ValidateAsync(StudentEmail, Pass, myDevice);

                ResultTextView.Text = $"{result.Status}\n{result.Fullname}\n{result.Token}";
            };
        }
예제 #2
0
        private async void Validate()
        {
            var Verificador = FindViewById <TextView>(Resource.Id.Verificador);

            SALLab06.ServiceClient ServiceClient = new SALLab06.ServiceClient();

            string StudentEmail = "*****@*****.**";
            string password     = "******";
            string myDevice     = Android.Provider.Settings.Secure.GetString(ContentResolver, Android.Provider.Settings.Secure.AndroidId);

            SALLab06.ResultInfo Result = await ServiceClient.ValidateAsync(StudentEmail, password, myDevice);

            /* Android.App.AlertDialog.Builder Builder = new AlertDialog.Builder(this);
             * AlertDialog Alert = Builder.Create();
             * Alert.SetTitle("Resultado de la verificacion");
             * Alert.SetIcon(Resource.Drawable.Icon);
             * Alert.SetMessage($"{Result.Status}\n{Result.Fullname}\n{Result.Token}");
             * Alert.SetButton("OK", (s, ev) => { });
             *
             * Alert.Show();*/

            Verificador.Text = ($"{Result.Status}\n{Result.Fullname}\n{Result.Token}");
        }