I'm trying to upload photo to Flickr, but this code is throwing an exception of file not found.The image is in the folder, but I don't know why Android is throwing an exception. Please help.
OAuthRequest request = new OAuthRequest(Verb.POST,
"http://api.flickr.com/services/upload/");
service.signRequest(accessToken, request);
MultipartEntity entity = new MultipartEntity();
entity.addPart("photo", new FileBody(new File("/test/res/drawable-hdpi/icon.png"),
"image/png"));
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
entity.writeTo(out);
request.addPayload(out.toByteArray());
request.addHeader(entity.getContentType().getName(),
entity.getContentType().getValue());
Response response = request.send();
String body = response.getBody();
} catch (IOException e) {
e.printStackTrace();
}