title: Permission to write on SD card android
body: <p>I have a problem writing to the SD card, here is the code:
  (Sorry about the layout of the code, just copy pased it )</p>
  
  <pre><code>public class SaveAndReadManager {
  
   private String result;
   private String saveFileName = "eventlist_savefile";
  
   public String writeToFile( ArrayList&lt;Event&gt; arrlEvents ){
    FileOutputStream fos = null;
    ObjectOutputStream out = null;
  
    try{
     File root = Environment.getExternalStorageDirectory();
  
     if( root.canWrite() ){
      fos = new FileOutputStream( saveFileName );
      out = new ObjectOutputStream( fos );
      out.writeObject( arrlEvents );
  
      result = "File written";
  
      out.close();
     }else{
      result = "file cant write";
     }
    }catch( IOException e ){
     e.printStackTrace();
     result = "file not written";
    }
  
    return result;
   }
  
   public boolean readFromFile(){
    return false;
   }
  }
  </code></pre>
  
  <p>I have not implemented the readFromFile() yet. 
  The problem is that root.canWrite() returns false all the time.
  Here is the manifest file:</p>
  
  <p>
  </p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  
  &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
      &lt;activity android:name=".InfoScreen"
             android:label="@string/app_name"&gt;
        &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>    &lt;activity android:name=".EventCalendar"
                android:label="@string/app_name" /&gt;
  
      &lt;activity android:name=".MakeEvent"
                android:label="@string/app_name" /&gt;
  
      &lt;activity android:name=".ViewEvent"
                android:label="@string/app_name" /&gt;
  
  &lt;/application&gt;
  &lt;uses-sdk android:minSdkVersion="8" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>I've asked for the permission to write, and on my avd, if i go to settings -> SD card and phone storage, it tells me i have 1 gb on the sd card to write on. Please help.</p>
  
  <p>Thanks:)</p>