2014-06-13 3 views

답변

1
private void storeImage(Bitmap image) { 
File pictureFile = getOutputMediaFile(); 
if (pictureFile == null) { 
    Log.d(TAG, 
      "Error creating media file, check storage permissions: ");// e.getMessage()); 
    return; 
} 
try { 
    FileOutputStream fos = new FileOutputStream(pictureFile); 
    image.compress(Bitmap.CompressFormat.PNG, 90, fos); 
    fos.close(); 
} catch (FileNotFoundException e) { 
    Log.d(TAG, "File not found: " + e.getMessage()); 
} catch (IOException e) { 
    Log.d(TAG, "Error accessing file: " + e.getMessage()); 
} } 
1

강타하고 여기에 도와주세요

String path = dir + value; 
      File localConfigfile = new File(
        Environment.getExternalStorageDirectory() 
          + "/Avalon/assets/www/" + path); 
      String responseString = RequestMgr.GetWebSource(DomainName 
        + "/" + Heirarchy + "/" + Serverpath); 
      FileOutputStream out; 
if (localConfigfile.exists()) { 
        localConfigfile.delete(); 
        out = new FileOutputStream(localConfigfile); 
        out.write(responseString.getBytes()); 
       } 
      } 

입니다. 성능을 위해 비트 맵과 URI를 사용하는 경우 좋은 옵션이 될 것입니다.

+0

샘플 또는 코드의 링크를 제공해 줄 수 있습니까? –

관련 문제