I have been successfully able to create files in my apps local directory using the below code
File appDir = new File(this.getExternalFilesDir(null), "my_folder");
if (!appDir.exists())
{
boolean result = appDir.mkdir();
if (!result) {
Log.i(Util.TAG, LOG_LABEL
+ ":: Unable to create \"my_folder\" Directory : "
+ appDir.getAbsolutePath()
+ " Directory already exists !");
}
}
File HTMLFile = new File(appDir,"html.txt");
But now when I tried to do the same from a service, the file was not being created, I even checked using 'HTMLFile.exists()' and it says the file does not exist.
My question is, Is it actually possible to create files from a service? or am I missing something here.