XS Labs

Facebook profile picture sync to GMail and phonebook

by pompo500 on Aug.24, 2010, under Software

facebook > gmail > phone sync

How would you like to see your friends’ Facebook profile pictures in your phone’s phonebook? Or GMail’s contacts? For free! Note: this only works with contacts you already have on your GMail’s contact list. For importing Facebook’s contacts to your contact list first, see this link.

Interested? Here’s a how-to.

What you need:

  • Facebook account, obviously
  • GMail or Google Apps account (if you don’t know what Google Apps is, don’t worry; this doesn’t concern you)
  • You should have your GMail contacts by their full names. E.g. “John Smith” instead of just “John”. This application only works with full names. “John Smith IBM inc.” works though, because it searches for the Facebook full name in GMail’s contact list.
  • Windows
  • .NET framework 3.5

How do I know if I have the .NET 3.5 framework? If you have Windows Vista or 7 or you frequently update or XP, you should have it. If you want to check you can go to Windows’ “Add or Remove Programs” to check if it’s mentioned there. If you need to install it, you can grab it easily from here.

Instructions

  1. Download FacebookGmailPhoneSync.xslabs.zip, unpack it somewhere, e.g. desktop or C:\Program Files\FacebookGmailPhoneSync
  2. Run FacebookGmailPhoneSync.exe
  3. Enter your GMail or Google Apps account details, click “Sync”
  4. Log in to Facebook
  5. It doesn’t have a progress bar, it just quietly runs a while
  6. After it’s done, it pops up “Done.”
  7. That’s it, it may take a few minutes for the pictures to update into your GMail, and if you’ve set up GMail <-> Cell phone sync, to your phone!

If there’s any error, please check the “What you need” section again, and please note that XS Labs does not offer any support for this, since this software is not originally ours and it’s free anyways.

Is it safe?

Yes, XS Labs has reviewed the source code, and it does not save or send your private information anywhere.

Should you want to see it for yourself, see the “Source code” section.

Source code

If you don’t know what source code means, you don’t need to download this. You only need to follow the “Instructions” section. Source code is intended for developers who want to modify this program.

Download FacebookGmailPhoneSync.xslabs-source.zip

What you need to compile FacebookGmailPhoneSync from source code:

  1. Microsoft Visual Studio, preferably 2008 or newer version. Search xs.fi for “dreamspark” and see if you’re eligible for the free version.
  2. The FacebookGmailPhoneSync.xslabs-source.zip mentioned above, unpacked somewhere
  3. Google Data API Setup (1.6.0.0) or newer from http://code.google.com/p/google-gdata/downloads/list

Credits

GoogleContactSync was not developed by XS Labs. Original credits go to www.koushikdutta.com

However, XS Labs has modified the program a bit (the source code in it’s current form didn’t work and relied on having Microsoft Office installed).

Changes made in MainForm.cs:

  1. deleted “using Microsoft.Office.Interop” lines.
  2. commented out “Microsoft.Office.Interop.Outlook.ApplicationClass app = new ApplicationClass();” and following three lines.
  3. replaced “match.Google.PhotoEditUri” with “match.Google.PhotoUri”

Changes made in Facebook API (Entity/User.cs):

  1. Added enum “Widowed” to User.RelationshipStatus, that was causing Exceptions with people who had widowed friends

10 Comments for this entry

  • Ujin

    I get this error…=/

    See the end of this message for details on invoking
    just-in-time (JIT) debugging instead of this dialog box.

    ************** Exception Text **************
    System.ArgumentException: Requested value ‘Widowed’ was not found.
    at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
    at Facebook.Parser.UserParser.ParseUser(XmlNode node)
    at Facebook.API.FacebookAPI.GetUserInfo(String userIds)
    at GoogleContactSync.MainForm.mySyncButton_Click(Object sender, EventArgs e)

    [the rest snipped out by pompo500]

    • pompo500

      @Ujin: Try downloading the .zip again, I made a new build.

      Developer talk: (will be gibberish to normal people)
      Apparently you have a friend in your friend list who’s relationship status is “Widowed”, which the Facebook API that was used to compile this program didn’t have. I added the status and hopefully it should work now. Probably should’ve updated the Facebook API to the newest version to have other possible issues sorted out, but I don’t want to risk breaking the API compatibility as with this API I get deprecation warnings..

  • Jo

    Also here an Exception:
    Facebook.Exceptions.FacebookException: Invalid parameter
    bij Facebook.API.FacebookAPI.ErrorCheck(XmlDocument doc)
    bij Facebook.API.FacebookAPI.LoadXMLDocument(String rawXML)
    bij Facebook.API.FacebookAPI.CreateSession()
    bij Facebook.API.FacebookAPI.ConnectToFacebook()
    bij GoogleContactSync.MainForm.mySyncButton_Click(Object sender, EventArgs e)
    bij System.Windows.Forms.Control.OnClick(EventArgs e)
    bij System.Windows.Forms.Button.OnClick(EventArgs e)
    bij System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
    bij System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    bij System.Windows.Forms.Control.WndProc(Message& m)
    bij System.Windows.Forms.ButtonBase.WndProc(Message& m)
    bij System.Windows.Forms.Button.WndProc(Message& m)
    bij System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    bij System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    bij System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    Any suggestions?

  • Jo

    And another one with more info: (here, facebook was already opened and logged in with IE6)

    ************** Tekst van uitzondering **************
    Facebook.Exceptions.FacebookException: Invalid parameter
    bij Facebook.API.FacebookAPI.ErrorCheck(XmlDocument doc)
    bij Facebook.API.FacebookAPI.LoadXMLDocument(String rawXML)
    bij Facebook.API.FacebookAPI.CreateSession()
    bij Facebook.API.FacebookAPI.ConnectToFacebook()
    bij GoogleContactSync.MainForm.mySyncButton_Click(Object sender, EventArgs e)
    bij System.Windows.Forms.Control.OnClick(EventArgs e)
    bij System.Windows.Forms.Button.OnClick(EventArgs e)
    bij System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
    bij System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    bij System.Windows.Forms.Control.WndProc(Message& m)
    bij System.Windows.Forms.ButtonBase.WndProc(Message& m)
    bij System.Windows.Forms.Button.WndProc(Message& m)
    bij System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
    bij System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    bij System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    ************** Geladen assembly’s **************
    mscorlib
    Assembly-versie: 2.0.0.0
    Win32-versie: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    —————————————-
    GoogleContactSync
    Assembly-versie: 1.0.0.0
    Win32-versie: 1.0.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/Johan/Bureaublad/FacebookGmailPhoneSync.exe
    —————————————-
    System.Windows.Forms
    Assembly-versie: 2.0.0.0
    Win32-versie: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
    —————————————-
    System
    Assembly-versie: 2.0.0.0
    Win32-versie: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
    —————————————-
    System.Drawing
    Assembly-versie: 2.0.0.0
    Win32-versie: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
    —————————————-
    Google.GData.Contacts
    Assembly-versie: 1.6.0.0
    Win32-versie: 1.6.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/Johan/Bureaublad/Google.GData.Contacts.DLL
    —————————————-
    Facebook
    Assembly-versie: 1.7.3888.27032
    Win32-versie: 1.7.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/Johan/Bureaublad/Facebook.DLL
    —————————————-
    Google.GData.Client
    Assembly-versie: 1.6.0.0
    Win32-versie: 1.6.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/Johan/Bureaublad/Google.GData.Client.DLL
    —————————————-
    Google.GData.Extensions
    Assembly-versie: 1.6.0.0
    Win32-versie: 1.6.0.0
    CodeBase: file:///C:/Documents%20and%20Settings/Johan/Bureaublad/Google.GData.Extensions.DLL
    —————————————-
    System.Core
    Assembly-versie: 3.5.0.0
    Win32-versie: 3.5.30729.1 built by: SP
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
    —————————————-
    System.Configuration
    Assembly-versie: 2.0.0.0
    Win32-versie: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
    —————————————-
    System.Xml
    Assembly-versie: 2.0.0.0
    Win32-versie: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
    —————————————-
    System.Web
    Assembly-versie: 2.0.0.0
    Win32-versie: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_32/System.Web/2.0.0.0__b03f5f7f11d50a3a/System.Web.dll
    —————————————-
    mscorlib.resources
    Assembly-versie: 2.0.0.0
    Win32-versie: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
    —————————————-
    Microsoft.mshtml
    Assembly-versie: 7.0.3300.0
    Win32-versie: 7.0.3300.0
    CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll
    —————————————-
    System.Windows.Forms.resources
    Assembly-versie: 2.0.0.0
    Win32-versie: 2.0.50727.3053 (netfxsp.050727-3000)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_nl_b77a5c561934e089/System.Windows.Forms.resources.dll
    —————————————-

  • Allison the Facebook Girl

    Wonderful, that’s exactly what I was scanning for! Your article just saved me alot of searching around

    I’ll make sure to put this in good use!

  • kourampies

    Sadly it crashes for me like most people commenting.

  • CChris

    I have tried the original App and your modification… both of them crashes with the JIT-Debugging Message posted in some comments above :-(

  • Angelo

    Just the same error reported by Jo..

    Facebook.Exceptions.FacebookException: Invalid parameter
    in Facebook.API.FacebookAPI.ErrorCheck(XmlDocument doc)
    in Facebook.API.FacebookAPI.LoadXMLDocument(String rawXML)
    in Facebook.API.FacebookAPI.CreateSession()
    in Facebook.API.FacebookAPI.ConnectToFacebook()
    in GoogleContactSync.MainForm.mySyncButton_Click(Object sender, EventArgs e)
    in System.Windows.Forms.Control.OnClick(EventArgs e)
    in System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
    in System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    in System.Windows.Forms.Control.WndProc(Message& m)
    in System.Windows.Forms.ButtonBase.WndProc(Message& m)
    in System.Windows.Forms.Button.WndProc(Message& m)
    in System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    in System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

  • maximus

    ************** Exception Text **************
    Facebook.Exceptions.FacebookException: Invalid parameter
    at Facebook.API.FacebookAPI.ErrorCheck(XmlDocument doc)
    at Facebook.API.FacebookAPI.LoadXMLDocument(String rawXML)
    at Facebook.API.FacebookAPI.CreateSession()
    at Facebook.API.FacebookAPI.ConnectToFacebook()
    at GoogleContactSync.MainForm.mySyncButton_Click(Object sender, EventArgs e)
    at System.Windows.Forms.Control.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ButtonBase.WndProc(Message& m)
    at System.Windows.Forms.Button.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

  • maximus

    got this
    ************** Exception Text **************
    Facebook.Exceptions.FacebookException: Invalid parameter
    at Facebook.API.FacebookAPI.ErrorCheck(XmlDocument doc)
    at Facebook.API.FacebookAPI.LoadXMLDocument(String rawXML)
    at Facebook.API.FacebookAPI.CreateSession()
    at Facebook.API.FacebookAPI.ConnectToFacebook()
    at GoogleContactSync.MainForm.mySyncButton_Click(Object sender, EventArgs e)
    at System.Windows.Forms.Control.OnClick(EventArgs e)
    at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
    at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
    at System.Windows.Forms.Control.WndProc(Message& m)
    at System.Windows.Forms.ButtonBase.WndProc(Message& m)
    at System.Windows.Forms.Button.WndProc(Message& m)
    at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Leave a Reply

Public service announcement

From the council of desultory bulletins:

The rate, at which feces fly, is simply stunning compared to the ionized gaps between nanoparticles upon impact of the floral microscopic patterns of neutron stars.
You should think about it for a moment. After all, it affects the longevity of random synergized spatulas.