2012-01-14 3 views
0

이 코드를 사용하여 서버에서 pdf 파일을 다운로드했지만 파일이 약 3GB라는 점에서 시간이 많이 걸리고 있습니다.이 문제를 해결할 다른 방법이 있습니까? 제발 도와주세요안드로이드에서 pdf를 다운로드하는 더 좋은 방법은?

FileOutputStream f = new FileOutputStream(file); 

      byte[] buffer = new byte[1024*10000]; 
      int len1 = 0; 
      while ((len1 = in.read(buffer)) > 0) { 
       f.write(buffer,0, len1); 
     } 

      f.close(); 

     OutputStream outStream = null; 
     outStream = new FileOutputStream(file); 

     outStream.close(); 

답변

1

DownloadManager apis를 사용하여 파일을 다운로드 할 수 있습니다. Android에서 파일을 다운로드합니다.

관련 문제