I am doing a OCR application in android. For that I need to store the trained data and the images in my application folder. Until now I was doing it using
public static String DATA_PATH = Environment.getExternalStorageDirectory().toString() + "/NewsReader/"
and that works absolutely fine on devices that have external SD cards.
But when I try to run the same application on device which either don't have SD cards inserted and work on internal storage or device like Nexus which have only internal storage the app fails. What alternatives do I have here. I can check the state of the External storage to see if its available or not but If not then what should my app do instead of just crashing. I even tried doing getFilesDir().toString() + "/NewsReader/"
but the same results.
EDIT
From some answers that I am getting my above question does not tell what my real problem is Let me clear it more.
I am doing this : public static String DATA_PATH = Environment.getExternalStorageDirectory().toString() + "/NewsReader/"
and it perfectly creates the folder NewsReader in the phone when I run it on the device which have external SD cards. But fails to run on the devices with only internal storage.
And to add up currently I am doing all this file creating business in my splsh activity in a thread but earlier when I was doing the same code in my normal Activities OnCreate it used to run on all devices.