I have data on a server which stores name and images.
I want to retrieve that from server and display in table layout on Android.
I wonder which is the best xmlparsing or json parsing for that purpose.
Is there any tutorial for that?
if($_REQUEST['mode']=="get")
{
$result = mysql_query("SELECT state,imageurl FROM `pic_upload`");
while($row = mysql_fetch_assoc($result))
{
$output=$row;
print(json_encode($output));
}
mysql_close;
}
using this i will get data from server but how to get data using xml parsing any one know
It seems that
json_encode($output)will produce a JSON output, so you should use Android’s JSON API (org.json).A quite recent tutorial is located at http://www.androidhive.info/2012/01/android-json-parsing-tutorial/ (also showing how to put retrieved elements on a list), but you will find many simply googling for Android and JSON.