title: How to create folder in the internal storage instead of /storage/emulated/0 in Android?
body: <p><a href="https://i.stack.imgur.com/3dPLJ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3dPLJ.jpg" alt="enter image description here" /></a>I am trying to create an app that would create a folder inside the internal storage of the Android device in the same name as the app. (like Whatsapp) I have been trying to implement this using &quot;mkdir&quot;. Here is the sample code I am trying:</p>
  <pre><code>File appFolder;
      String path = Environment.getExternalStoragePublicDirectory(Environment.getRootDirectory().getParent())
              .getAbsolutePath() +&quot;/student&quot;;
  
      appFolder = new File(path);
  
      if(!appFolder.exists()){
          boolean b = appFolder.mkdir();
      }
  </code></pre>
  <p>The problem is that the folder is being created in &quot;/storage/emulated/0&quot; directory. But I want it to be created in the root of Internal storage like Whatsapp.(like the pic where there is a folder for &quot;Collage maker&quot; app) How can I achieve that? Thanks in advance for your kind support in this regard.</p>
  <hr />