W temacie VLC: http://git.videolan.org/?p=vlc-ports/an … 60;hb=HEAD
public static String[] getStorageDirectories()
{
String[] dirs = null;
BufferedReader bufReader = null;
try {
bufReader = new BufferedReader(new FileReader("/proc/mounts"));
ArrayList<String> list = new ArrayList<String>();
list.add(Environment.getExternalStorageDirectory().getPath());
String line;
while((line = bufReader.readLine()) != null) {
if(line.contains("vfat") || line.contains("exfat") ||
line.contains("/mnt") || line.contains("/Removable")) {
StringTokenizer tokens = new StringTokenizer(line, " ");
String s = tokens.nextToken();
s = tokens.nextToken(); // Take the second token, i.e. mount point
if (list.contains(s))
continue;
if (line.contains("/dev/block/vold")) {
if (!line.startsWith("tmpfs") &&
!line.startsWith("/dev/mapper") &&
!s.startsWith("/mnt/secure") &&
!s.startsWith("/mnt/shell") &&
!s.startsWith("/mnt/asec") &&
!s.startsWith("/mnt/obb")
) {
list.add(s);
}
}
}
}
dirs = new String[list.size()];
for (int i = 0; i < list.size(); i++) {
dirs[i] = list.get(i);
}
}
catch (FileNotFoundException e) {}
catch (IOException e) {}
finally {
if (bufReader != null) {
try {
bufReader.close();
}
catch (IOException e) {}
}
}
return dirs;
}
Sorry, ale to jakiś hack a nie normalna metoda pobrania ścieżki do karty SD. ;)
https://www.youtube.com/watch?v=jofNR_WkoCE