长话短说:我正试图通过一个名为abugadro的android应用在google代码上发表评论和制造问题。
我在这里遵循了一段非常相似的代码:
Google Spreadsheet API update \ edit with protocol
当试图在api上发表评论时,根据我使用的头,我得到了各种各样的错误,比如403和501。
不管怎样,代码会说话,所以我的文章是:

HttpPost postRequest = new HttpPost("http://code.google.com/feeds/issues/p/"+projName+"/issues/"+issueId+"/comments/full");

postRequest.addHeader("Content-Type","application/atom+xml;charset=UTF-8");
postRequest.setHeader("Authorization", "GoogleLogin auth=" + auth);
postRequest.addHeader("User-Agent", "abugadro-v"+getResources().getString(R.string.version));
postRequest.addHeader("Accept-Encoding","gzip");
postRequest.addHeader("GData-Version", "1.0");
//postRequest.addHeader("If-Match", "*");//Not entirely sure if I should use this or not

HttpEntity se = new StringEntity(xml,"UTF-8"); //Contains the comment info
postRequest.setEntity(se);

issuetrackerapi对于我应该使用哪种类型的头来正确地发布非常模糊。
http://code.google.com/p/support/wiki/IssueTrackerAPI#Modifying_an_issue_or_creating_issue_comments
另外,我知道有一个gdata java客户端,但是在android上使用这个a p i没有一个明智的方法可以不用拖拽大约2兆jar。
我真的很感谢你的帮助,这件事让我无法理解。
再次感谢。

最佳答案

google api最好的android库是支持android的google-api-java-clientgdata-java-client不支持android。
google api java客户端支持问题跟踪器api,但还没有它的示例。请make a request for a sample。同时,您还可以查看一些为android编写的其他示例,比如picasa-atom-android-samplecalendar-v2-atom-android-sample

关于java - Google Code Issue Tracker API帮助,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/3744415/

10-09 06:55
查看更多