Android external data storage problems
<p>I'm trying to store data on the SD card, according to the guide <a href="http://developer.android.com/guide/topics/data/data-storage.html">here</a> I should be using <code>getExternalFilesDir()</code> (API level 8), I would really like to do so but calling<br>
<code>File directory = context.getExternalFilesDir(null);</code> keeps returning <code>null</code>, I'm using my main activity as context.<br>
Then I tried reverting to use <code>File dir = Environment.getExternalStorageDirectory();</code>, it correctly returns the SD root, but apparently I am unable to create the suggested "/Android/data/package_name/files/" directory:</p>

<pre><code>    File root = Environment.getExternalStorageDirectory();
    File dir = new File(root, GlobalConstants.EXTERNAL_SAVE_DIR);
    boolean canCreate = dir.mkdirs();
</code></pre>

<p>In this code <code>canCreate</code> is false (EXTERNAL_SAVE_DIR is obviously /Android/data/package_name/files/).</p>

<p>Is there anything I'm missing, maybe should I ask permissions on the Manifest (I found nothing about)? I've read <code>getExternalFilesDir()</code> has a bug where contents get deleted on application update, I don't really care about that and I would rather use it instead of the other one as I'm trying to conform to API 8 and I like the idea of it handling the directory name for me.  </p>

<p>Any idea?</p>
