Android Question httputils2 and really simple task

jimseng

Active Member
Licensed User
Longtime User
Hi.
I am struggling to understand a really simple thing:

http://192.168.1.128/test.php?device=led&state=on
in my php I have
$dev=$_GET["device"];
$stat= $_GET["state"];
and I know that works by pasting it into a browser but i can't work out how to send this from b4a. Sorry for being such a newbie but I have been struggling for ages.
Can someone show me how to do it.
(I have been reading the tutorials but I'm afraid I just don't understand them)
Thanks
 

sorex

Expert
Licensed User
Longtime User
it could be something like this

B4X:
 Dim dlj As HttpJob
dlj.Initialize("setLed",Me)
dlj.Download("http://192.168.1.128/test.php?device=led&state=on")
 
Upvote 0

jimseng

Active Member
Licensed User
Longtime User
Hi.
I have found I need some feedback from the web server to check that it has happened. The web page just does an echo of the parameters. Ho can I retreive that into a string to check it?
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
you need the jobdone sub where you can read out the response.

do a search on jobdone and you should find the tutorial.
 
Upvote 0
Top