I have read over the various other postings on this and have not yet found an answer that is working for me. They have been discussing the use of External Storage and I need to use 'default' (internal) storage.
I have a very simple routine in one of my Activity routines
String PATH = "/data/data/com.mydomain.myapplicationname/files";
SystemIOFile.MkDir(PATH); // Ensure Recipient Path Exists
And then in my SystemIOFile class I have
static public Boolean MkDir(String directoryName)
{
Boolean isDirectoryFound = false;
File Dir = new File(directoryName);
if(Dir.isDirectory())
{
isDirectoryFound = true;
} else {
Dir.mkdirs();
if (Dir.isDirectory())
{
isDirectoryFound = true;
}
}
Dir = null;
return isDirectoryFound;
}
And in my Android.Manifest.xml I have
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
So it seems as though all of the pieces are in place for this to work.
BUT it is not working.
When I single step through the MKDir() routine it ALWAYS fails.
The
if (Dir.isDirectory())
always returns false
And the subsequent Dir.mkdirs() always returns false
What am I missing?