title: How to uri to SD card mp3 file
body: <p>I am trying to play an mp3 file stored in my SDcard. I am not using an emulator but a Samsung Galaxy S3 with cyanogenmod 13 android 6.0. </p>
  
  <p>First I tried with </p>
  
  <p><code>Uri.parse(Environment.getExternalStorageDirectory().getPath()+"/gato.mp3")</code></p>
  
  <p>but the </p>
  
  <p><code>Environment.getExternalStorageDirectory().getPath()</code>
   gets me to /storage/emulated/0.</p>
  
  <p>With the file manager in my phone I see 3 memory storage places:</p>
  
  <ol>
  <li>Internal storage is located in the /storage/emulated/0. </li>
  <li>sdcard1 is
  in /storage/FE97-A11B </li>
  <li>secure storage apart.</li>
  </ol>
  
  <p>Which are different from what I see exploring from my computer (only sdcard1 and internal storage).</p>
  
  <p>I couldnt make it work so I put the file "gato.mp3" in both internal and sdcard1, and I can check is there. But with</p>
  
  <p><code>Environment.getExternalStorageDirectory().getPath()+"/gato.mp3"</code></p>
  
  <p>which gives me the path /storage/emulated/0/gato.mp3, which should get me to the file, and also trying to set the path manually to /storage/FE97-A11B/gato.mp3, the mediaplayer created with the uri is null, and no file is found.
  Same if I try the paths I see in the computer explorer.</p>
  
  <p>Anybody has any idea on why it cannot find the file?
  I have tried removing "/" at the beggining, adding "mnt" to see if i was missing something in the path, but nothing seem to work.</p>
  
  <p>Thank you for your time!</p>
  
  <p>My code to check is just a function</p>
  
  <pre><code>public void ejecutar(View v) {
  
      Uri datos = Uri.parse(Environment.getExternalStorageDirectory().getPath()+"/gato.mp3");
  
      MediaPlayer mp = MediaPlayer.create(this, datos);
  
      if (mp != null) {
          mp.start();
      }
      else{ tv1.setText(datos.toString());}
  </code></pre>
  
  <p>where tv1 is a textview so i can see which path the uri is pointing to.</p>