ok i think i know what you want. basically you want to read a website with a httpurlconnection, then you're searching for the variable from the what you read, and then you need to make a POST to the site, for like a form or so.
this is just the posting part. im too lazy to experiment for you, so you'll have to do the first part yourself. I hope this helps you somewhat. Just read the documentation, and collect examples. good luck