안녕하세요. ^^;;앱 개발에 앞서 제목과 마찬가지로 질문이 있습니다.android 2.x 대 버전에서는 위와 같이 /data/data/[자기 패키지명]/files에 데이터를 저장해서 앱에서 불러오게끔 하는게 되었는데 4.0.3버전의 갤노트에서 같은 소스를 돌리니 데이터 저장이 안되서요;; 

 

소스코드는 다음과 같습니다.

 

   new DownloadFileFromURL().execute(SN.getInputStringFromUrl("SN.connectURL),
    this.getApplicationInfo().sourceDir+"/files/test.db"); 


아래의 소스를 위와 같이 불러옵니다.;

 

         protected String doInBackground(String... DataURL) { 
            
         int count; 
            try { 
             Log.i("test progress",DataURL[0]);
                URL url = new URL("DataURL[0]); 
                URLConnection conection = url.openConnection(); 
                conection.connect(); 
                // this will be useful so that you can show a tipical 0-100% progress bar 
                int lenghtOfFile = conection.getContentLength(); 
  
                Log.i("test FileOutput",DataURL[1] );
                // download the file 
                InputStream input = new BufferedInputStream(url.openStream()); 
                Log.i("test fileinput","input..");
                // Output stream 
                OutputStream output = new FileOutputStream(DataURL[1]); 
                Log.i("test fileinput","input..2");
                
                byte data[] = new byte[1024];            
                long total = 0; 
  
                while ((count = input.read(data)) != -1) { 
                    total += count; 
                    publishProgress(""+(int)((total*100)/lenghtOfFile)); 
  
                    // writing data to file 
                    output.write(data, 0, count); 
                } 
                Log.i("test total",total+"");
                // flushing output 
                output.flush(); 
  
                // closing streams 
                output.close(); 
                input.close(); 
  
            } catch (Exception e) { 
                Log.e("Error: ", e.getMessage()); 
            } 
  
            return null; 
        }