Chris Simpson Chris Simpson - 5 months ago 15x
Android Question

How do I determine whether a path is a local file or not

Given just a location as a string, is there a reliable way to determine if this is a local file (such as /mnt/sdcard/test.jpg) or a remote resource (such as

Converting it to a Uri with Uri.parse doesn't seem to give me anything to indicate where the file is.

I don't really want to have to look for // in the string!


uri format is


local files have:


or just


so if string starts with


and this is not file:// then this is url