Issue in android programming json to listview -
i have been using following code in order create listview:
public class androidjsonparsingactivity extends listactivity { // url make request private static string url = "http://api.androidhive.info/contacts/"; // json node names private static final string tag_contacts = "contacts"; private static final string tag_id = "id"; private static final string tag_name = "name"; private static final string tag_email = "email"; private static final string tag_address = "address"; private static final string tag_gender = "gender"; private static final string tag_phone = "phone"; private static final string tag_phone_mobile = "mobile"; private static final string tag_phone_home = "home"; private static final string tag_phone_office = "office";
this 1 above works, if change into:
private static string url = "http://kondicioner.al/app/json.php"; // json node names private static final string tag_contacts = "contacts"; private static final string tag_id = "id"; private static final string tag_name = "emer"; private static final string tag_email = "mbiemer"; private static final string tag_address = "telefon"; private static final string tag_gender = "adresa"; private static final string tag_phone = "ora"; private static final string tag_phone_mobile = "per"; private static final string tag_phone_home = "dyqan"; private static final string tag_phone_office = "statusi";
it won't work now.i don't understand may problem, it's supposed work, same structure same thing... thanks
the json structures different.
this how first structure looks (i have retained 1 record brevity):
{ "contacts":[ { "id":"c200", "name":"ravi tamada", "email":"ravi@gmail.com", "address":"xx-xx-xxxx,x - street, x - country", "gender":"male", "phone":{ "mobile":"+91 0000000000", "home":"00 000000", "office":"00 000000" } } ] }
and how second structure looks like:
{ "contacts":[ { "id":"12", "emer":"albana", "mbiemer":"", "telefon":"", "adresa":"", "ora":"10:13:44", "per":"", "dyqan":"", "statusi":"", "orari_transportit":"", "data":"15\/4\/2013" } ] }
Comments
Post a Comment