【发布时间】:2012-01-04 13:16:52
【问题描述】:
我已经在这个问题上几天了,我很困惑。
我在很多地方都读到了 google 提供的 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("anAccount@gmail.com", "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【问题讨论】:
-
@norbert 您对此有什么解决方案吗?你能分享我你的代码或链接吗?
-
我已经解决了 GData api 的问题。看到这个帖子(noundla.blogspot.in/2014/01/…)
标签: java android google-contacts-api