According to the source code of File.java, pathSeparator
is pulled from the char System.getProperty("path.separator", ":").charAt(0)
. separator
, on the other hand, comes from System.getProperty("file.separator", "/").charAt(0)
.
Because Android is Linux-based, it should always be /
. However, I have seen glitches where :
has appeared instead (Motorola Droid; see bug report), by using the default value above.
When I code, I always use /
... to be honest, I don't think it's necessary to reference the File
class (this would mostly be for non-Android work). It's just best to stick to /
, I think.
Additionally, according to this answer (pertains to Java, not just Android), /
can safely be used on all Java platforms, and it will figure out what it needs to use internally.