I\'ve been able to retrieve everything but the contacts photo by following the API.
I can get the img url as well as the gd:etag from the xml returned. Below is the Goog
Use the same authorized request code used for retrieving contacts and just replace the url with the link rel url of the contact image. Response will be the bytes of the image. Use the following code to return image as response.
//'in' is the inputStream returning from the call, response is the HttpServletResponse
ByteArrayOutputStream out = new ByteArrayOutputStream();
byte[] buffer = new byte[4096];
int read;
while (true) {
if ((read = in.read(buffer)) != -1) {
out.write(buffer, 0, read);
} else {
break;
}
}
response.setContentType("image/jpeg");
response.setContentLength(buffer.length);
request.getSession().setAttribute("image", new String(out.toByteArray()));
response.getOutputStream().write(buffer);