Possible Duplicate:
How to implement communication between Java client application (Android) and PHP server application?
I'm busy with a project. My android app needs to request server info from time to time.
The solution i came up with was to write a php script. But how do you let the android java app communicate with the PHP script ?
I was thinking about something with a post/get request and the php script returning a html file with strings ?
Would love some advice, thanks in advance :)
From Android, do HTTP GET/POST requests to reach the PHP script. Have the PHP script return JSON formatted data - much easier to parse and deal with than HTML.
see this tutorial it will help you
you can exchange array between them by JSON,most of language support JSON. in php you can use json_encode(); json_decode();
to make json array.and Java should have something same as it. eg:
$array = array(
"fname" => "Moein"
"lname" => "Hoseini"
);
$js = json_encode($array);