I am writing an android app where the end user will capture pictures. Normally, I would store application data (worth a few KB) in the internal storage. But here, these pictures come around to 450K each, and there could be several of them.
Since the internal storage is limited, is it a good idea to store these images there or should I go with the External Storage? I'm just looking for best practice suggestions here. Thank you.
It depend on your app functionality and how big images will grow.
Storing on external storage is better to save internal storage space, but you should beaware that external storage is not always available (e.g. when USB is connected in file transfer mode) so you need to check if it is mounted first, here an example helper function
public boolean isExternalStorageMounted() {
String state = Environment.getExternalStorageState();
if (Environment.MEDIA_MOUNTED.equals(state)) {
return true;
}
return false;
}
Also, you should avoid creating an independent folder on the SD card if you want your files to be deleted when the app is uninstalled, you should use getExternalFilesDir()
to your directory where you can save your images, that will be removed when your app is uninstalled.