Edit: I'm extremely sorry for how poorly I asked my question at first, I was extremely frustrated and tired but I know that really isn't an excuse. Anyway, I edited it. I have also already looked a lot on the StackOverflow forums and other ones and tried the methods on their, without result so I guess this isn't really a duplicate question.
After hours of trying and using several methods I finally gave up and decided to post the question here. So frustrating that I can't get this to work, it's for a home automation project and learning new languages like C and python was never a problem while working on this project so not getting this to work is extremely frustrating. Anyway here is the code:
public void buttonOnClick(View v) {
Button button = (Button) v;
((Button) v).setText("clicked");
// The request here
// The request here
// The request here
// The request here
}
This is a simple application with one button that should send a simple http get request to 192.168.0.150/main_light/switch. I know this is supposed to work since I've always used HTTP GETs in Tasker for this (and it works in Python). I really hope someone can help me out here, thank you!
P.S. I know there are stil useless actions in here, I'm a JAVA Noob and decided just to not mess with anything until I can finally get this working.