i have following php file….
mysql_connect("localhost","root","");
mysql_select_db("database_name");
$sql=mysql_query("select * from members");
while($row=mysql_fetch_assoc($sql)) $output[]=$row;
print(json_encode($output));
mysql_close();
?>
with this i get all that data in android following is my android content,
BufferedReader reader = new BufferedReader(new InputStreamReader(
is, "iso-8859-1"), 8);
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
is.close();
String json = sb.toString();
i have get json as a string. From android but now i want use that data in listview. I can’t understand how can i use it. Please give me some idea or suggestions.
Parse Data from Json and Save it in ArrayList and set that arrayList to Listview.
You can create Json object from String like below.
You can create Json Array object from String like below.
Look at this Tutorial .