title: android Environment.getExternalStorageDirectory().getPath()
body: <p>I have this code:</p>
  
  <pre><code>try {
              URL url = new URL (strURL);
              input = url.openStream();
              byte[] buffer = new byte[1500];
              OutputStream output = new FileOutputStream ("/sdcard/"+pos+".png");
  </code></pre>
  
  <p>and I get this error: 
  do not hardcode /sd card/ use environment.getexternalstoragedirectory().getpath() instead
  in         </p>
  
  <pre><code> OutputStream output = new FileOutputStream ("/sdcard/"+pos+".png");
  </code></pre>
  
  <p>I have read about that:<a href="https://stackoverflow.com/questions/13459280/android-4-2-environment-getexternalstoragedirectory-getpath-behaviour">Android 4.2 - Environment.getExternalStorageDirectory().getPath() behaviour</a></p>
  
  <p>So the question is what will be final code when I replace it?</p>