1
votes

Consider code snippet:

    String[] roots = FileSystemStorage.getInstance().getRoots();

    String root = roots[0];
            for (int i = 0; i < roots.length; i++) {
                if (FileSystemStorage.getInstance().getRootType(roots[i]) == FileSystemStorage.ROOT_TYPE_MAINSTORAGE) {
                    root = roots[i];
                    break;
                }
            }
return root;

On Android device, atleast in my case, this returns format : "/storage/emulated/0 .." but on iOS something like "file://var/mobile...". Is this intentional ? Why does iOS add "file://" ? It took me hours to find out why file paths resolve correctly on Android (i was repending file:// ) and not on iOS.

1

1 Answers

1
votes

There was an issue about this a while back and I don't recall the exact reason why it wasn't made formally consistent eventually. A file: URL will work on Android and on iOS consistently and both should accept a file beginning with / too.

I guess we were just too timid to make that change to the code. I'll fix this on Android for the next update, hopefully it won't break everything...