Wednesday, 2 October 2013

Use URI builder in an Android App

Use URI builder in an Android App

I'm developing an Android app. I need to build a URI for my app, to make
an API request. Unless there's another way to put a variable in a URL,
this is the easiest way I've found. I found that you need to use
Uri.Builder, but I'm not quite sure how to. My url is:
http://lapi.transitchicago.com/api/1.0/ttarrivals.aspx?key=[redacted]&mapid=`value`.
My scheme is http, authority lapi.transitchicago.com, path /api/1.0, path
segments ttarrivals.aspx, and query key=[redacted]&mapid=value.
I understand that I do uri.add, but how do I integrate it into the URI
builder? Would I add every thing, like URI.add(scheme),
URI.add(authority), and so on?
Thank you for your help.

No comments:

Post a Comment