Whats the External SDcard Path?

Johnyb6273

New member
Apr 15, 2016
2
0
0
Im trying to move tomtom maps to the SD card which requires updating the path in a mxl file. The app crashes with the following and I've tried other combinations to no avail. Help appreciated

<url location="file:///mnt/sdcard/Android/data/com.tomtom.europe"/>
 
Some third party file managers tell you what the path is, like Solid explorer. That could be a way to figure out the exact path code.
 
I just figured out something. At least for every phone I came across today and even my Android Emulator had the SD Card Path like ' /storage/????-???? ' where every ? is a capital letter or a digit.

So, if /storage/ directory has a directory which is readable and that is not the internal storage directory, it must be the SD Card.

My code worked on all phones I tested and even on my android emulator!

String removableStoragePath;
File fileList[] = new File("/storage/").listFiles();
for (File file : fileList)
{ if(!file.getAbsolutePath().equalsIgnoreCase(Environment.getExternalStorageDirectory().getAbsolutePath()) && file.isDirectory() && file.canRead())
removableStoragePath = file.getAbsolutePath(); }
//If there is an SD Card, removableStoragePath will have it's path. If there isn't it will be an empty string.

If there is an SD Card, removableStoragePath will have it's path. If there isn't it will be an empty string.
 

Forum statistics

Threads
954,933
Messages
6,963,232
Members
3,163,151
Latest member
kacau