Example #1
0
        async Task <bool> fnGetProfileInfoFromGoogle()
        {
            progress = ProgressDialog.Show(this, "", "Please wait...");
            bool isValid = false;
            //Google API REST request
            string userInfo = await fnDownloadString(string.Format(googUesrInfoAccessleUrl, access_token));

            if (userInfo != "Exception")
            {
                googleInfo = JsonConvert.DeserializeObject <GoogleInfo> (userInfo);
                isValid    = true;
            }
            else
            {
                if (progress != null)
                {
                    progress.Dismiss();
                    progress = null;
                }
                isValid = false;
                Toast.MakeText(this, "Connection failed! Please try again", ToastLength.Short).Show();
            }
            if (progress != null)
            {
                progress.Dismiss();
                progress = null;
            }
            return(isValid);
        }
		async Task<bool> fnGetProfileInfoFromGoogle()
		{ 
			progress =  ProgressDialog.Show (this,"","Please wait..."); 
			bool isValid=false;
			//Google API REST request
			string userInfo = await fnDownloadString (string.Format(googUesrInfoAccessleUrl, access_token ));  
			if ( userInfo != "Exception" )
			{ 
				googleInfo = JsonConvert.DeserializeObject<GoogleInfo> ( userInfo );   
				isValid = true;
			}
			else
			{ 
				if ( progress != null )
				{
					progress.Dismiss ();
					progress = null;
				}   
				isValid = false;
				Toast.MakeText ( this , "Connection failed! Please try again" , ToastLength.Short ).Show (); 
			}
			if ( progress != null )
			{
				progress.Dismiss ();
				progress = null;
			}  
			return isValid;
		}