Haipad M701 using /nand directory when I request external storage
<p>I have an Android app which by preference uses external storage if available to store various files but will use internal storage if external storage is unavailable.</p>

<p>I've extended Application and maintain a static File for the app's working directory as follows...</p>

<pre><code>public class MyApp extends Application {
    protected static File myFilesDir = null;
    protected static Helper myHelper = null;

    @Override
    public void onCreate() {
        super.onCreate();

        myHelper = new Helper(this);
        if (myHelper.CanWriteExtStorage()) {
            Log.d(TAG, "onCreate() - myHelper.CanWriteExtStorage() returned TRUE");
            myFilesDir = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/Android/data/" + packageName + "/files");
        }
        else {
            Log.d(TAG, "onCreate() - myHelper.CanWriteExtStorage() returned FALSE");
            myFilesDir = new File(getFilesDir().getAbsolutePath());
        }
        myFilesDir.mkdirs();

        if (!myFilesDir.equals(null)) {
            Log.d(TAG, "onCreate() - myFilesDir: " + myFilesDir.getAbsolutePath());
}
</code></pre>

<p>The app is currently being beta-tested by some people I'm in direct contact with and one guy commented that he thought I was supposed to be using the SD card if available but he could see from logcat the app was using <code>/nand/Android/data...</code> I asked what /nand referenced and he said it is internal memory on his pad/tablet device.</p>

<p>The code the Helper class uses to check for external storage is as follows...</p>

<pre><code>protected boolean CanWriteExtStorage() {
    boolean mExternalStorageWriteable = false;
    String state = Environment.getExternalStorageState();
    if (Environment.MEDIA_MOUNTED.equals(state))
            mExternalStorageWriteable = true;
    return mExternalStorageWriteable;
}
</code></pre>

<p>...but the relevant log output is as follows...</p>

<pre><code>D/com.mycompany.myapp(3844): onCreate() - myHelper.CanWriteExtStorage() returned TRUE
D/com.mycompant.myapp(3844): onCreate() - myFilesDir: /nand/Android/data/com.company.myapp/files
</code></pre>

<p>So, the question is why, when I'm able to test that the external storage state shows it is mounted, would <code>Environment.getExternalStorageDirectory()</code> return a path to what appears to be internal storage?</p>

<p>Should I be testing for something other than <code>Environment.MEDIA_MOUNTED</code> or is there just something strange about this device or Android version (he is running v2.1).</p>

<p>In the long run it possible doesn't matter but I'm concerned my logic is incorrect for certain devices.</p>
