Am realmente now..I Frustated desea descargar un archivo de Dropbox y guardar ese archivo en SDCARD..and me dieron el código como:descarga de archivos desde Dropbox y guardarlo en SDCARD
private boolean downloadDropboxFile(String dbPath, File localFile) throws IOException{
BufferedInputStream br = null;
BufferedOutputStream bw = null;
try {
if (!localFile.exists()) {
localFile.createNewFile(); //otherwise dropbox client will fail silently
}
FileDownload fd = api.getFileStream("dropbox", dbPath, null);
**br = new BufferedInputStream(fd.is);**
bw = new BufferedOutputStream(new FileOutputStream(localFile));
byte[] buffer = new byte[4096];
int read;
while (true) {
read = br.read(buffer);
if (read <= 0) {
break;
}
bw.write(buffer, 0, read);
}
} finally {
//in finally block:
if (bw != null) {
bw.close();
}
if (br != null) {
br.close();
}
}
return true;
}
Aquí estoy recibiendo un error en nuevos br = line..Pls BufferedInputStream ayudan
También copie/pegue el error y stacktrace. –
He copiado pegado este código desde el enlace: http: //stackoverflow.com/questions/6180926/android-dropbox-api-file-download...Y en mi código no está reconociendo "fd.is" – Kanika
¿Estás seguro que 'fd.is! = null'? –