2012-01-04 120 views
2

我一直在這個好幾天,並且我感到困惑。谷歌在android上的聯繫人API

我讀過很多地方的java客戶端谷歌提供「不會在Android上工作」,它不。

有人能指出我正確的方向嗎?

public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.main); 


    ContactsService service = new ContactsService("my_app_name"); 


    URL feedUrl = null; 
    try { 
     feedUrl = new URL("https://www.google.com/m8/feeds/contacts/default/full"); 
    } catch (MalformedURLException e) { 
     e.printStackTrace(); 
    } 

    try { 
     service.setUserCredentials("[email protected]", "thePassword"); 

     ContactFeed resultFeed = new ContactFeed(); 

     resultFeed = service 
       .getFeed(feedUrl, ContactFeed.class); 
    } catch (IOException e) { 
     e.printStackTrace(); 
    } catch (ServiceException e) { 
     e.printStackTrace(); 
    } 

} 

,我也得到:

 
W/XmlParser(793): javax.xml.parsers.ParserConfigurationException: org.xml.sax.SAXNotRecognizedException: http://xml.org/sax/features/external-parameter-entities 
+0

所以你嘗試了什麼? – Selvin 2012-01-04 13:34:48

+0

@norbert你有沒有解決這個問題的方法?你能分享我的代碼或鏈接嗎? – Noundla 2014-01-20 10:06:09

+0

我已經用GData API解決了這個問題。看到這個帖子(http://noundla.blogspot.in/2014/01/fetch-googlegmail-contacts-using-google.html) – Noundla 2014-01-21 13:50:35

回答