In Android, when to use a Uri, when to use a path, when to add file:// before the path when not?
I just feel confused that different places need different form of file paths.
Can anyone tell the difference and help me be clear which to use in what situation?
I found that some methods receives a Uri as parameter while others need path with or without the file:// prefix.
Is there a clear rule saying where to use what or it’s just depending on the programmer’s individual preference?
These are three different things.
If you are want to add Uri then it can be device sdcard image uri or any specific target uri(Uniform Resource Identifier). see example
If you want to point out or path of assets folder or any folder in your app then you have to put file:/// before it.
These things are path represent in different ways.
Or in any other do you want please tell me.