I'm developing an app with google drive and I can see my files with these app. I want to download the files, but I can't. This is my function, is equal to google documentation:
Thanks un advance!!
/* Download a file's content.
*
* @param service Drive API service instance.
* @param file Drive File instance.
*
* @return InputStream containing the file's content if successful, {@code null} otherwise.
*/
public static InputStream downloadFile(Drive service, File file) throws IOException
{
if (file.getDownloadUrl() != null && file.getDownloadUrl().length() > 0)
{
try
{
HttpResponse resp = service.getRequestFactory().buildGetRequest(new GenericUrl(file.getDownloadUrl())).execute();
return resp.getContent();
}
catch (IOException e)
{
// An error occurred.
e.printStackTrace();
return null;
}
}
else
{
// The file doesn't have any content stored on Drive.
return null;
}
}
No errors in Logcat, but I don't see any file in downloads, sd-card, etc
If there isn't error, I have to see very carefull in sd-card, system etc?
it's necessarely anything else??