Difference between different manufacturers

126 Views Asked by At

Currently I am working with files in android and in order to create directory I used mkdir() command. The issue is, it worked on devices like Samsung,LG,Pixel and few others while it didn't work in One Plus of same API version. Replacing mkdir() with mkdirs() made it to work in one plus also. I would like to know how this varies from manufacturer to manufacturer.

1

There are 1 best solutions below

2
masoud vali On

That's because the root folder in each manufacturer is different so when you call mkdirs() it will create the parent folder for your file so you don't need to address them yourself