コード例 #1
0
        public async System.Threading.Tasks.Task Validate()
        {
            var txt1 = FindViewById <TextView>(Resource.Id.txt1);
            var txt2 = FindViewById <TextView>(Resource.Id.txt2);
            var txt3 = FindViewById <TextView>(Resource.Id.txt3);

            SALLab09.ServiceClient client = new SALLab09.ServiceClient();
            string myD = Android.Provider.Settings.Secure.GetString(
                ContentResolver, Android.Provider.Settings.Secure.AndroidId);


            Result =
                await client.ValidateAsync(
                    StudentEmail, Password, myD);

            txt1.Text = $"{Result.Fullname}";
            txt2.Text = $"{Result.Status}";
            txt3.Text = $"{Result.Token}";
        }
コード例 #2
0
        private async void ValidarActividad()
        {
            try
            {
                SALLab09.ServiceClient client = new SALLab09.ServiceClient();

                SALLab09.ResultInfo result = await client.ValidateAsync("", "",
                                                                        Android.Provider.Settings.Secure.GetString(ContentResolver,
                                                                                                                   Android.Provider.Settings.Secure.AndroidId));

                RunOnUiThread(() =>
                {
                    FindViewById <TextView>(Resource.Id.UserNameValue).Text = result.Fullname;
                    FindViewById <TextView>(Resource.Id.StatusValue).Text   = Enum.GetName(typeof(SALLab09.Status), result.Status);
                    FindViewById <TextView>(Resource.Id.TokenValue).Text    = result.Token;
                });
            }
            catch (Exception ex)
            {
                Toast.MakeText(this, $"Error: {ex.Message}", ToastLength.Long).Show();
            }
        }