void SendRegistrationToAppServer(string token) { // Add custom implementation here as needed //net.azurewebsites.agc20171.AISCM a = new net.azurewebsites.agc20171.AISCM(); net.azurewebsites.aiscm.WebService1 w = new net.azurewebsites.aiscm.WebService1(); //a.update_gcm_token(Global_portable.email,token); System.Diagnostics.Debug.WriteLine("email:" + Global_portable.email + "token" + token); w.update_gcm_token(Global_portable.email, token); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here SetContentView(Resource.Layout.monitorstatus); //net.azurewebsites.agc20171.AISCM aiscm = new net.azurewebsites.agc20171.AISCM(); net.azurewebsites.aiscm.WebService1 aiscm = new net.azurewebsites.aiscm.WebService1(); MainActivity g = new MainActivity(); TextView temp = FindViewById <TextView>(Resource.Id.textView3); TextView mois = FindViewById <TextView>(Resource.Id.textView4); }
async private void LoginProcess(string email) { IPerson plusUser = PlusClass.PeopleApi.GetCurrentPerson(mGoogleApiClient); System.Diagnostics.Debug.WriteLine("email in login page:" + email); //net.azurewebsites.agc20171.AISCM agc = new net.azurewebsites.agc20171.AISCM(); net.azurewebsites.aiscm.WebService1 w = new net.azurewebsites.aiscm.WebService1(); string url = "http://192.168.0.4:5010/signin?email=" + email; string abc = ""; using (var client = new HttpClient()) { var result = await client.GetStringAsync(url); abc = result.ToString(); System.Diagnostics.Debug.WriteLine("response" + result + "" + abc); //return JsonConvert.DeserializeObject<YourModelForTheResponse>(result); } //int id = Convert.ToInt32(w.signin(email)); int id = Convert.ToInt32(abc); System.Diagnostics.Debug.WriteLine("id:" + id); MainPage mp = new MainPage(); mp.user_type = id.ToString(); mp.email = email; MainActivity ma = new MainActivity(); ma.email += email; Global.login = 1; Global_portable.email = email; user_email = email; Global_portable.user_id = id; for (int i = 0; i < 5; i++) { //w.update_farm_status("25", "23", "1", "10", "on", "1"); } switch (id) { case -1: break; case 0: Toast.MakeText(this, "INVALID USER!!!" + id, ToastLength.Long).Show(); break; case 1: Toast.MakeText(this, "Authenticated" + id, ToastLength.Long); StartActivity(typeof(MainActivity)); break; case 2: //StartActivity(typeof(farmer_home)); Toast.MakeText(this, "From addfarmer page..." + id, ToastLength.Long); StartActivity(typeof(MainActivity)); //await Xamarin.Forms.Application.Current.MainPage.Navigation.PushModalAsync(new MainPage()); break; case 3: Toast.MakeText(this, "In Company login..." + id, ToastLength.Long); StartActivity(typeof(MainActivity)); break; } string location = plusUser.CurrentLocation; }
public async void OnConnected(Bundle connectionHint) { //Successful log in hooray!! mSignInClicked = false; if (mInfoPopulated) { //No need to populate info again return; } if (PlusClass.PeopleApi.GetCurrentPerson(mGoogleApiClient) != null) { System.Diagnostics.Debug.WriteLine("in login page..."); IPerson plusUser = PlusClass.PeopleApi.GetCurrentPerson(mGoogleApiClient); var email = PlusClass.AccountApi.GetAccountName(mGoogleApiClient); System.Diagnostics.Debug.WriteLine("email in login page:" + email); //net.azurewebsites.agc20171.AISCM agc = new net.azurewebsites.agc20171.AISCM(); net.azurewebsites.aiscm.WebService1 w = new net.azurewebsites.aiscm.WebService1(); int id = Convert.ToInt32(w.signin(email)); System.Diagnostics.Debug.WriteLine("id:" + id); MainPage mp = new MainPage(); mp.user_type = id.ToString(); mp.email = email; Global.email = email; MainActivity ma = new MainActivity(); ma.email += email; Global.login = 1; Global_portable.email = email; user_email = email; Global_portable.user_id = id; switch (id) { case -1: break; case 0: Toast.MakeText(this, "INVALID USER!!!" + id, ToastLength.Long).Show(); break; case 1: Toast.MakeText(this, "Authenticated" + id, ToastLength.Long); StartActivity(typeof(MainActivity)); break; case 2: //StartActivity(typeof(farmer_home)); Toast.MakeText(this, "From addfarmer page..." + id, ToastLength.Long); StartActivity(typeof(MainActivity)); //await Xamarin.Forms.Application.Current.MainPage.Navigation.PushModalAsync(new MainPage()); break; } string location = plusUser.CurrentLocation; /* if (plusUser.HasDisplayName) * { * mName.Text += plusUser.DisplayName; * } * * if (plusUser.HasTagline) * { * mTagline.Text += plusUser.Tagline; * } * * if (plusUser.HasBraggingRights) * { * mBraggingRights.Text += plusUser.BraggingRights; * * } * mEmail.Text += email; * if(plusUser.HasImage) * { * ImageView im = FindViewById<ImageView>(Resource.Id.imageView1); * * } * if(plusUser.HasBirthday) * { * mBraggingRights.Text += plusUser.Birthday; * } * * if (plusUser.HasRelationshipStatus) * { * switch (plusUser.RelationshipStatus) * { * case 0: * mRelationship.Text += "Single"; * break; * * case 1: * mRelationship.Text += "In a relationship"; * break; * * case 2: * mRelationship.Text += "Engaged"; * break; * * case 3: * mRelationship.Text += "Married"; * break; * * case 4: * mRelationship.Text += "It's complicated"; * break; * * case 5: * mRelationship.Text += "In an open relationship"; * break; * * case 6: * mRelationship.Text += "Widowed"; * break; * * case 7: * mRelationship.Text += "In a domestic partnership"; * break; * * case 8: * mRelationship.Text += "In a civil union"; * break; * * default: * mRelationship.Text += "Unknown"; * break; * } * } * * if (plusUser.HasGender) * { * switch (plusUser.Gender) * { * case 0: * mGender.Text += "Male"; * break; * * case 1: * mGender.Text += "Female"; * break; * * case 2: * mGender.Text += "Other"; * break; * * default: * mGender.Text += "Unknown"; * break; * } * }*/ mInfoPopulated = true; } }