codeOverflow
codeOverflow

Reputation: 85

Creating a folder with file in Android's internal storage

i'm trying to create a folder with a .csv file inside in android internal storage, but the folder doesn't appear in the regular file explorers.

The code is the following.

private String FOLDER_NAME = "app_folder";

File folder = new File(Environment.getDataDirectory().getAbsolutePath() + File.separator + FOLDER_NAME);
if( !folder.exists() ) 
    folder.mkdir();

Upvotes: 0

Views: 550

Answers (1)

CommonsWare
CommonsWare

Reputation: 1006724

but the folder doesn't appear in the regular file explorers.

That is because internal storage cannot be viewed by any sort of file explorer, except on emulators or rooted devices.

File explorers — on-device and desktop — usually examine external storage.

Upvotes: 4

Related Questions