I'm trying to populate a listview with data picked from a remote database, using PHP to interrogate the database and return to the android code the results. After this I'd like to show the results in a listview (kinda like Twitter does).
How can I achieve all of this?
This is the PHP code:
<?php
require 'jsonwrapper.php';
mysql_connect("****","*****","****");
mysql_select_db("****");
$q=mysql_query("SELECT * FROM articoli");
while($raw=mysql_fetch_assoc($q)) {
$output[]=$raw;
}
print(json_encode($output));
mysql_close();
?>
From this I receive an array of strings like this:
[{"titolo":"TestData","articolo":"Vediamo ora se inserisce la data come gli ho detto di fare anche la scorsa volta. Solo che la scorsa volta non accettava il metodo di formattazione della data quindi inseriva una stringa vuota","data":"","media":"","idutente":""},{"titolo":"Prova","articolo":"contenuto dell'articolo di prova","data":"28032014_185338","media":"","idutente":""}]
I was thinking about receiving this array in a single string and then manipulate it to get the title, the content of the article and the date (even if I don't know how to manipulate the strings to get to this result). Can you help me? Make some code example please cause telling me "try to use arrayadapter" doesn't work too much xD
P.S.: I read an unthinkable number of tutorials, answers in this site etc. but nothing helped me…