Alexandru Circus
Alexandru Circus

Reputation: 5538

Storing files on SD card/internal storage

I work for an application that records sound. The recordings are stored on sdcard using as root path: Environment.getExternalStorageDirectory().getAbsolutePath();. I assume there are some devices without sdcard(removable or not), just with internal storage. How should I proceed with these phones for storing the recording? Also I have a file explorer for the user to be able to pick up a desired location for the recordings.

If the presence of sdcard is missing (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED);) should I simply inform the user he has no space to record, or just to write on the internal storage?

Upvotes: 1

Views: 1129

Answers (2)

MrKekson
MrKekson

Reputation: 740

Read this.

Also in my opinion you either have a setting to select the storage, and then inform the user if there are no empty space left, but make shure that the recorded sound did not get lost( for example you recorded the first word of a kid, and then you lost the record because of no space), or you can throw a question on them, where to save, but for easy use, you should have a default place, so you dont need to browse directoryes after each recording.

Upvotes: 1

g00dy
g00dy

Reputation: 6778

Following the discussion from the comments below the question:

Put up a Dialog and let the user decide if he/she wants to use the internal memory (show him/her how much's left and how much you require). Before doing anything, let the user decide each step. If you already record the files, you can ask the user to choose to remove them or not. It's just a natural way to get the things done, without thinkink about simplifying the life of the user.

Finally, from here :

context.getFilesDir(); //to get folder
getApplicationContext(); //and the context is retrieved by calling this

Upvotes: 0

Related Questions