0

I'm trying to create a directory on my Android device using the following code:

// If directory doesn't exist, create it.
File fileDir = new File(Environment.getExternalStorageDirectory() , "MyApp");
if (!fileDir.isDirectory()) {
    fileDir.mkdir();
}

I believe the directory is being created in /storage/emulated/0/. How can I create it to be publicly viewable in the internal storage?

For example, when the phone is connected to my PC, it should be in Phone/MyApp. Thanks!

petehallw
  • 1,014
  • 6
  • 21
  • 49
  • https://stackoverflow.com/questions/32789157/how-to-write-files-to-external-public-storage-in-android-so-that-they-are-visibl – CommonsWare Sep 26 '16 at 15:50
  • `/storage/emulated/0/` is the "root" directory show on your PC. But inside Android (as it is a Linux file system) that's the location. – Budius Sep 26 '16 at 19:21

0 Answers0