I'm trying to create a basic application where I want to send a request from android to php server like this: http://www.eg.com/eg.php?a=blabla:blablabla:bla.
Then when i get this data I want do something like this:
if(isset($_GET['a'])) {
$a = $_GET['a'];
$array = explode(':', $a);
$data1 = $array[0];
if($data1 == "blabla") {
Send response to android here..
}
}
The problem is that i dont know how to send data to and back from android to php server. I looked at many answers but most send json data or use the depreciated apache http library or does not talk anything about the php server side or are specific to secnario of that person. Please can you give me a very clear answer on how to do this, thanks :)
If there is an answer that already covers this question, please provide my with the url for that answer before voting me down.
I have finally found a simple solution with the help of the comments and hours of research:
You can simple call this method by using this:
Java code:
On the php side you can get the data by using:
you can send back response by simply doing this: