How to play with gmail contacts?

Hi Friends,
How do I get gmail contacts using gdata library? I searched gdata libary, but I couldn't find any hint.
Right now I am able to insert any contacts to my gmail id. But how can I get all my contacts in my java program?
Here is a program I am using to create new contact and insert it to my gmail id
import com.google.gdata.client.*;
import com.google.gdata.client.contacts.*;
import com.google.gdata.data.*;
import com.google.gdata.data.contacts.*;
import com.google.gdata.data.extensions.Email;
import com.google.gdata.data.extensions.ExtendedProperty;
import com.google.gdata.util.*;
import java.io.IOException;
import java.net.URL;
public class Gcontacts {
     public static ContactEntry createContact(ContactsService myService,
               String name, String notes) throws ServiceException, IOException {
          // Create the entry to insert
          ContactEntry contact = new ContactEntry();
          contact.setTitle(new PlainTextConstruct(name));
          contact.setContent(new PlainTextConstruct(notes));
          Email primaryMail = new Email();
          primaryMail.setAddress("[email protected]");
          primaryMail.setRel("http://schemas.google.com/g/2005#home");
          primaryMail.setPrimary(true);
          contact.addEmailAddress(primaryMail);
     URL postUrl = new URL("http://www.google.com/m8/feeds/contacts/[email protected]/full");
          return myService.insert(postUrl, contact);
     public static void main(String[] args) {
          ContactsService myService = new ContactsService("exampleCo-exampleApp-1");
          try {
               myService.setUserCredentials("[email protected]", "************");
               ContactEntry cobj=createContact(myService,"Harshit","Test purpose");
               System.out.println("Returned :"+cobj.toString());          
          } catch (AuthenticationException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
          } catch (ServiceException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
          } catch (IOException e) {
               // TODO Auto-generated catch block
               e.printStackTrace();
}which method should I use to get all my contacts list? and Also how do I update particular contact from this kind of program?
Please help.
Thanks

You're probably better off finding a forum on google.com specifically dealing with their APIs.

Similar Messages

  • Duplicated contact when I synced with gmail contact and iCloud. How can I do?

    Duplicated contact when I synced with gmail contact and iCloud. How can I do?

    On your iOS device tap Settings > iCloud. Turn Contacts off.
    Reset the device. Hold the On/Off Sleep/Wake button and the Home button down at the same time for at least ten seconds, until the Apple logo appears.
    Now tap Settings > iCloud. Turn Contacts back on.

  • Syncing iphone contacts with Gmail contacts through itunes

    is there a way to sync my iphone contacts and calendar with Gmail contacts and calendar directly through itunes?
    when i am on itunes and i open teh drop menu next to contacts, i only get teh option of windowns contacts or  outlook. i saw in some blogs this same drop menu having google contacts as well.
    i jsut have a gmail account. does it ieed a google plus account or something? why isn't it appearing in the itunes menu?
    i have iphone 4 running ios 6.1.3 and the latest version of itunes.

    hi ArtisticGeek
    i am more concerned with syncing contacts and calendar (just the same way i sync them now with outlook)
    i am refering to the attached picture and the dtop menu in it and wondering why i don't have the same.
    reason being that i have a samsung tablet and an iphone and i just want to be able to have the same contact list and calendar notes on both and the only common platform to do that is Google contacts.

  • How do I download gmail contacts to mail?

    how do I download gmail contacts to mail?

    Do it through iTunes, connect the iPad > open iTunes > select iPad on left > Info > check mark sync contacts > configure your Google contacts.

  • HT204150 How do I get gmail contacts to my iPad?

    How do I get gmail contacts to my iPad?

    Google is ceasing Exchange support. The recommended method is the one I posted above.
    See: http://googleblog.blogspot.ca/2012/12/winter-cleaning.html

  • How do I sync my IPhone 4S with GMail contacts

    My IPHONE 4S does not sync contacts with GMAIL  How can I have them sync?

    I just learned how at Apple store today.
    Set-up your gmail email account on iPhone as a Microsoft Exchange account type, NOT a Gmail.
    Do not use a domain
    When asked, after initial verify, enter the following for the server:  m.google.com
    I then deleted the other gmail email account I had set-up previously.
    Works great for me!

  • HT1296 I lost my sync with gmail contacts with Iphone on Itunes.  How I can do that again?

    I want to know how I can sync my Iphone contacts with my google contacts again?

    Hello Eltontsang,
    Thank you for using Apple Support Communities.
    It sounds like you Google contacts are no longer syncing to your phone.
    This article should help you get back up and running in that regard:
    iOS: Syncing with Google Contacts
    http://support.apple.com/kb/HT4872
    Follow these steps if you're using iOS 7 to sync your contacts with Google Contacts:
    Tap Settings > Mail, Contacts, Calendars > Add Account > Google.
    Enter the required information in the fields.
    Make sure Contacts is on.
    After you have completed the setup, open the Contacts app on your device. Syncing should begin automatically.
    Additional Information
    If you're using iOS 5 or iOS 6, follow these steps to set up contact syncing with Google Contacts:
    Tap Settings > Mail, Contacts, Calendars > Add Account... > Other > Add CardDAV Account.
    Enter the following information in the fields:
    Server: google.com
    User Name: your full Google email address
    Password: your Google account password
    Tap Next at the top of the screen to complete the setup.
    After you have completed the setup, open the Contacts app on your device. Syncing should begin automatically.
    Note: Make sure that SSL is enabled (under Advanced settings) and the port is 443.
    You may also visit the Google website to learn more about syncing with Google contacts.
    All the very best,
    Sterling

  • How do i add Gmail contacts to iCloud?

    Has anyone figured out a way to sync Google Contacts and iCloud contacts?

    The first step would be exporting your GMail contacts as a vcard:
    http://mail.google.com/support/bin/answer.py?answer=24911&hl=en
    What you do next depends on how you've been syncing your iPhone 4 up until now:
    - if via iTunes on a Mac, import the vcard file(s) into Address Book app.  Then sync your contacts with your iCloud contacts (System Preferences > iCloud > Contacts[checked]).
    - if via iTunes on a PC, download the iCloud Control Panel (http://www.apple.com/icloud/setup/pc.html) and import the vcard file(s) into your contact manager program (Outlook, Outlook Express, etc.).

  • How do I sync Gmail contacts on my iPhone?

    I just switched to iPhone from an Android phone. How do I sync my Gmail contacts? My iPhone is pulling my Gmail, but I can't figure out how to sync Gmail contacts into my phone contacts.

    Hello carrie867,
    The following article contains step-by-step instructions for settings up Google Contact Sync on your iOS device:
    iOS: Syncing with Google Contacts
    http://support.apple.com/kb/HT4872
    Follow these steps to set up contact syncing with Google Contacts:
    Tap Settings > Mail, Contacts, Calendars > Add Account > Other > Add CardDav Account.
    Enter the following information in the fields:
    Server: google.com
    User Name: Enter your full Google email address
    Password: Your Google account password
    Select Next at the top of the screen to complete the setup.
    After you have completed the setup, open the Contacts app on your device. Syncing should begin automatically.
    Additional Information
    Note: Make sure that SSL is enabled (under Advanced settings), and that the port is 443.
    Best regards,
    Allen

  • Need help with Gmail Contact issue

    First I'm loving the phone! It's a great device and was a great decision to get. I haven't noticed any issues with the phone until today. When I purchased the phone on 3/22/13 everything synced up perfect. All my calendar entries and contacts sync from Gmail and has been fine since today. I got a log in error for my email and calendar this morning and I had an issue logging back in. So I removed the account and set it back up. Now all my contacts on my Gmail account are missing online. The contacts are still on my phone but not associated with my Gmail account. I went through most of them and some are associated with facebook, twitter and linkedin.
    Not sure how but that's not my issue. I will try to figure that out later. What I want is, if there's a way to transfer them back to my Gmail account?
    Again I have all the contacts and really don't want to manually enter them back into the phone.
    Any help will be grateful!

    From my own experience I had issues with Gmail. Later on I found out other people also had issues. These were with syncing.
    What may have happened is your Gmail account setup may have received the indication that you remotely deleted the contacts.
    As for myself, I found I had best results with Hotmail for syncing the contacts and etc.
    Jerry G.

  • Address book gives no option to sync with gmail contacts

    On my iMac, there is an option to sync with google contacts. On my MacBook there is not. How can I get the gmail contact option on my 2 year old MacBook

    I'm guessing your iMac is new enough to be running Snow Leopard and the MacBook is not, if so, install Snow Leopard on the MacBook.

  • How to play  with part of the video.??

    I mean that how can I separate the video to several parts,(maybe 2 frames to one part). and then How to play one part of them with JMF.
    I want to use this to implement the p2p system. If I can solove there two issues, I think I can use some routing arithmetic to transfer some parts to peers. The peer with one thread just play the current frame, and create another one to download the following parts.
    could you guys suggest me ??

    Yeah, I do p2p with jmf.
    In p2p system, the souce of video send the parts to the network(earch part has a UID,such as 1,2,3,4,5...), and the other computers receive some of them.(the parts must can play continuously) .And in the memery of each computer have a buffer to download the following parts from the network, not from the source.
    In this way, some peers of the network can communicate.For example,
    Peer A have the 1st ,3rd,5th parts,and Peer B have the 2nd,4th parts.
    When A paly the 1st part, at the same A download from B the 2nd part, Then A can play in turn. In the same way B can download the 3rd part from A.
    Maybe my way is not right, do you have another way to implement the p2p, or the materail about it.
    Waiting for your replay....

  • 2 way contact sync with gmail contacts

    I set up gmail account on iPhone (3GS), using Exchange option. When I enable the Contacts in iPhone setup, I see that all my Gmail contacts have transferred over to the iPhone (and I now have duplicates when looking at "All Contacts," but see there is a separate Gmail Contacts group which has only those Gmail contacts.
    However, if I add a new contact to Address Book, and then sync, that new contact does NOT sync over to Gmail, so it appears to be one way. I do have mobileme, but I realize that probably doesn't get it over to Gmail.
    So.... 2 questions:
    1) Is there a way to get true two way sync of contacts between iPhone and Gmail
    2) Is there any way to NOT have duplicate contacts when choosing All Contacts on iPhone (I suppose I could just leave it on Gmail Contacts, which if syncing 2 way, should show everything)...
    Thanks--

    Adding a contact on the phone syncs up to the Gmail contacts online satisfactorily (although I haven't tested different additions, like Fred & Wilma, vs. Barney)
    Editing contacts on the phone syncs up somewhat.  Eg, I have Barney Rubble, and edit it to show Barney & Betty Rubble. In the notes, I put 'Bam-Bam'.  The edited note will show up, but the name change will not.
    I'm resorting to the brute force method.  Deleting the contact entirely, and re-entering it.

  • How to play with javascripts from command line?

    This is a problem that I always have no clue how to deal with.
    To begin with, take a look at this page: http://jsharer.com/file/1345737.htm
    If you click on "[TUTHE@ManYv][D`z][FLCL][05][H264_Vorbis][E4273181].mkv", after a little while a little window pops up and if you right click on the "点击此处开始下载", you can copy the direct download link.
    I previously used a simple bash script using curl to parse direct download links from this site. I like to do it at command line. It was easy because the link used to be directly shown in the page source code (though I had to call curl twice for it, it was fine.)
    But now I can't. It's all javascript. I ain't got no idea how to deal with this kind of stuff. I made my attempt to look at the page source, all I can tell is that the <div id="download_block"> part and the <div id="lord_content"> line seems to be important.
    I want to use my old good command line instead of click click click!
    Can somebody help me with this? Or please just give me some hints. It'd be fully appreciated. Thanks!

    If you know python, the package community/python-mechanize lets you automate a lot of this kind of thing. You can tell it to go to url so-and-so, simulate a click on the third link matching regexp such-and-such, preserving cookies the original page gave you, and so on.
    Has made most of my webpage scraping a hell of lot easier.
    EDIT: but I don't know whether it processes embedded Javascript, perhaps not.
    Last edited by Profjim (2009-09-03 11:22:37)

  • How do I combine Gmail contacts, Contacts on MacBook Pro and iPhone5 without duplicating?

    I use a MacBook Pro, but my preferred mail is Gmail, so I have a lot of contacts on my MacBook from Gmail and just a few that have gradually crept into the Address Book that came with the MacBook Pro.  Just got a new iPhone 5 and have spent two days manually deleting duplicate contacts that were caused in the switch from my old Droid to the iPhone.  There MUST be a way to efficiently merge all three address/email sources without winding up with triplicate entries!
    Any suggestions?
    Thanks,
    ElyArtist

    You restore them from your most recent backup.
    Barry

Maybe you are looking for

  • I don't think I'm buying anther Lenovo product again

    Let me preface this message by stating that I'm a bit agitated since I just got off the phone with a Lenovo customer service representative in Atlanta Georgia that basically called me a liar. I am a IT MSP for a number of small companies in my area.

  • Issue with Fusion drive (Late 2012 iMac)

    I have a late 2009 iMac that has been backed up with Time Machine.  I recently picked up a late 2012 iMac with the 1TB Fusion drive.  When I first plugged in my Time Machine drive, I was asked if I'd like to transfer my files over.  I did, and everyt

  • Transaction INVMON - Process Bill Entry - Error message EDEREG_INV590

    Dear Gurus, I'm trying to configure a supply scenario on the Supplier side, the objective is to updload grid usage bills and process them to create an agregated invoice on the grid contract account and also inculde this grid usage bills in the next p

  • Format of response from distributed form

    Hi guys, I have been working with a trial of Acrobat X Pro and Livecycle ES II, to determine if we can use it effectively to replace paper forms in our workplace. We have also recently deployed Alfresco, an open source CMS, which is very tightly inte

  • How to stop adverts opening on their own when googling

    whenever i google, like when I'm researching for college work, random advertisements open whenever i click a link, in a new tab. it is sometimes adverts, sometimes saying I've 'won' and sometimes that mac keeper. how do i stop this from happening? it