Reputation: 1968
I am using StringBuilder
to create URI
to iterate with JSON Api.
Some people recommend to use Uri.Builder
for that purpose but can't explain why. Isn't that even redundant?
Upvotes: 2
Views: 345
Reputation: 23962
Assuming that you're talking about android.net.Uri
(and not java.net.URI
), I see 3 reasons:
appendQueryParameter
)I would say it is not something you would start holy-war about, but I prefer not using Uri
as this class is part of Android SDK - this makes your component automatically dependent on Android OS (therefore it's a bit harder to test and maintain).
Upvotes: 3