# File contains a path separator

**URL:** https://discourse.processing.org/t/file-contains-a-path-separator/6865
**Category:** Processing for Android
**Created:** [December 24, 2018, 3:35am UTC](https://discourse.processing.org/t/file-contains-a-path-separator/6865 "2018-12-24T03:35:50Z")
**Posts on this page:** 1
**Showing post:** 11

<div class="post-metadata">

### Author: ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)
#### Post date: [December 27, 2018, 3:35pm UTC](https://discourse.processing.org/t/file-contains-a-path-separator/6865/11 "2018-12-27T15:35:30Z")

</div>

@FurryNightShade===

yes, but this code does not answer to your question because you KNOW a) you hardcode the path b) the user cannot choose nothing; if you want to see all songs on your phone, try someting like that::

```auto
import android.os.Environment;

void setup(){
 size(800,1000);
 orientation(PORTRAIT);
 
  File f= Environment.getExternalStorageDirectory();//dossier de base
  parcoursDossier(f);
  
}

void draw(){
  
}
public void parcoursDossier(File dossier) {

        File[] listFile;///Array de tous les fichiers
        listFile = dossier.listFiles();//remplir l'array

        if (listFile != null) {
            for (int i = 0; i < listFile.length; i++) {
                if (listFile[i].isDirectory()) {//recursive call if it s a directory
                    parcoursDossier(listFile[i]);
                } else {
                  if (listFile[i].getName().toLowerCase().endsWith(".mp3")){///you can change .mp3 for other suff
                      
                      String nom = listFile[i].getName();
                      println("nom du fichier====" + nom);
                      println(listFile[i].getAbsolutePath());
                      
                      ///then you can read this file or do stuff with it: ocreate an arrayList, open an alertDialog and an adapter with your arrayList and leave the user choose!
                  }
                }
            }
        } else{
          
          println("je ne trouve rien");
        }
    }

```

---

_[View the full topic](https://discourse.processing.org/t/file-contains-a-path-separator/6865)._
