我已经在这几天了,我很困惑。
我在很多地方都读过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