Using internal storage instead of external (SD Card)

I need to use internal storage instead of external because I don’t want to place that requirement on my users. I’ve modified OFAndroid.java so that it looks like:

public static String getInternalStorageDirectory() {
    return OFAndroid.ofActivity.getFilesDir().getAbsolutePath();
}

Also, I change calls of

getRealExternalStorageDirectory() -> getInternalStorageDirectory().

And the lines

// String resName = ofActivity.getResources().getText(fileId).toString();
String resName = ofActivity.getResources().getText(fileId).toString().toLowerCase();

// ZipFile resourceszip = new ZipFile(dataPath+"/"+app_name+"resources.zip"); // orig.
ZipFile resourceszip = new ZipFile(dataPath+"/"+app_name.toLowerCase()+"resources.zip");

(The last two handle case conflicts; there should be an elegant way to do it, but I just want to convince myself that internal storage can be used.)

However, why is the use of external storage intended instead of internal?

Thanks,

JH

We chose to use external storage cause most phones 2 years ago had really little internal storage so it was problematic storing resources there. Even now it’s problematic with some old phones but we could have an option so you could easily choose to use internal or external storage

Hi,
Is 0.9 OF providing this internal / external storage option ?
@juanfhj did you succeed using internal storage ?

I think internal storage is the most compatible mode, if I want to publish an app, isn’t it ?

Thanks,
guillaume

And just to be clear,
is the /sdcard path a real external SD card path, and it means devices without sdcard won’t run apps with data ?
(or maybe it’s a link to a part of internal storage ?)

Beacuse Openframeworks+Android install notes says:

If there's no SD card in the device, examples that have resources won't work right now.

But I’ve found contradictory informations on web about /sdcard path

yes this will work in phones without an external sdcard. it should work on any device. most applications storing data after installing the app use this kind of storage (for example the kindle app…) so it should be ok to just use this.

ok thanks arturo !