async void DoAuthentication(string email, string password, string username)
        {
            // string timestamp = DateTime.Now.ToString("yyyyMMddHHmmss");

            string         myts  = DateTime.Now.ToString("yyyyMMddHHmmss");
            STPLoginSocial model = new STPLoginSocial
            {
                Username = email,
                Password = password,
                ts       = myts
            };

            model.hash = model.GetHashforSocial(myts);

            string response = "";

            try
            {
                response = await restService.ServiceAuthentication(model).ConfigureAwait(false);
            }
            catch (Exception e)
            {
                //cpd.DismissDialog();
                mGoogleApiClient.Disconnect();
                Toast.MakeText(this, e.Message, ToastLength.Long).Show();
            }
            mGoogleApiClient.Disconnect();
            Toast.MakeText(this, response, ToastLength.Long).Show();
            try
            {
                STPReg userinfo = new STPReg();

                userinfo = JsonConvert.DeserializeObject <STPReg>(response);

                if (response.Contains("ERROR"))
                {
                    //cpd.DismissDialog();

                    var socialintent = new Intent(this, typeof(Registration_Activity));
                    socialintent.PutExtra("email", email);
                    socialintent.PutExtra("username", username);
                    StartActivityForResult(socialintent, 125);
                }

                else
                {
                    //cpd.DismissDialog();
                    STPUserInfo userinfo2 = new STPUserInfo();

                    userinfo2 = JsonConvert.DeserializeObject <STPUserInfo>(response);
                    edit.Clear();
                    // login suceeded, parse json
                    edit.PutString("username", userinfo2.DisplayName);
                    edit.PutInt("userid", userinfo2.UserID);
                    edit.PutString("profilePath", userinfo2.ImageURL);
                    edit.PutBoolean("pluscard", userinfo2.PlusCard);
                    edit.PutBoolean("banned", userinfo2.Banned);
                    edit.Apply();
                    //cpd.DismissDialog();

                    Finish();
                    Toast.MakeText(this, "Welcome " + userinfo.DisplayName, ToastLength.Long).Show();
                }
            }

            catch (Exception)
            {
                //cpd.DismissDialog();
            }
        }
        async void DoAuthentication(string email, string password)
        {
            // string timestamp = DateTime.Now.ToString("yyyyMMddHHmmss");


            STPLoginSocial model = new STPLoginSocial
            {
                Username = email,
                Password = password,
            };

            model.hash = model.GetHashforSocial("");

            string response = "";

            try
            {
                response = await restService.ServiceAuthentication(model).ConfigureAwait(false);
            }
            catch (Exception e)
            {
                Toast.MakeText(this, e.Message, ToastLength.Long).Show();
            }

            try
            {
                STPReg userinfo = new STPReg();

                // userinfo = JsonConvert.DeserializeObject<STPReg>(response);

                if (response.Contains("ERROR"))
                {
                    userinfo.Username = email;
                    alreadyregistered = userinfo.Username;

                    var socialintent = new Intent(this, typeof(Registration_Activity));

                    StartActivityForResult(socialintent, 125);
                }

                else
                {
                    STPUserInfo userinfo2 = new STPUserInfo();

                    userinfo2 = JsonConvert.DeserializeObject <STPUserInfo>(response);
                    edit.Clear();
                    // login suceeded, parse json
                    edit.PutString("username", userinfo2.DisplayName);
                    edit.PutString("profilePath", userinfo2.ImageURL);
                    edit.PutInt("userid", userinfo2.UserID);

                    edit.Apply();

                    Finish();
                    Toast.MakeText(this, "Welcome " + userinfo.DisplayName, ToastLength.Long).Show();

                    var registerintent = new Intent(this, typeof(MainActivity));

                    StartActivityForResult(registerintent, 123);
                }



                // Toast.MakeText(this, "Welcome " + userinfo.Username, ToastLength.Long).Show();
            }


            catch (Exception)
            {
            }
        }