Why would one use Uri.Builder when Urls can be constructed by simply concatenating string variables?
In which cases is advisable to use uribuilder over string variables and vice-versa?
Always prefer uribuilder over strings to build a uri as uribuilder has a lot of built-in validation to ensure that the given address is well-formed. Generally speaking, if you know that your uri is going to remain constant through out then you can go ahead and use a string but in the case when you will be often re-constructing your uri by changing/replacing fields, uribuilder is a must!
Uri.Builder is a helper class using which you can offload the work of constructing various kinds of uri. It is always recommended to use this class instead of creating it yourself.
Uri.Builder