thanks all to response, now its working,
how to get the information from the JSONObjects
but i'm getting result in below formate -
{"Categories":[{"ID":1,"ImageName":"pepsi.png","Items":[{"AvailableQuantity":525,"Description":"Enjoy
potatoes cooked and flavoured with Indian herbs, served with Imli sauce. A
mouthful that’s never
enough.","ID":1,"ImageName":"samosasmall.jpg","ItemPrice":17,"Name":"Samosa","SmallImageName":"coffee.png"},{"AvailableQuantity":446,"Description":"A
delectable balance of creamy spinach, cheese and juicy corn satiates you
with a homely touch. Best served
grilled.","ID":2,"ImageName":"Spinachcorn_small.jpg","ItemPrice":96,"Name":"SpinachCorn","SmallImageName":"coffee.png"},{"AvailableQuantity":286,"Description":"Chicken
sausage wrapped in a puff pastry with juicy onion & mustard leaves you
tongue-twisted with
delight","ID":3,"ImageName":"Pizzasandwitchsmall5556.jpg","ItemPrice":91,"Name":"Mushroom
shallots mango
mustard","SmallImageName":"coffee.png"},{"AvailableQuantity":627,"Description":"Chicken
sausage wrapped in a puff pastry with juicy onion & mustard leaves you
tongue-twisted with
delight","ID":4,"ImageName":"Pizzasandwitchsmall5556.jpg","ItemPrice":99,"Name":"Veg
seek
kabab","SmallImageName":"coffee.png"},{"AvailableQuantity":137,"Description":"Chicken
sausage wrapped in a puff pastry with juicy onion & mustard leaves you
tongue-twisted","Status":true}
with this string, i created JSONObject like -
result = above string
JSONArray finalResult = new JSONArray(result);
int mytotal;
if (finalResult instanceof JSONArray) {
// JSONArray jsonArray = finalResult;
json = finalResult.getJSONObject(0);
json.put("loginresult", true);
// mytotal = json.getInt("total");
}
but how to get the information from the JSON Objects.
On Thu, May 19, 2011 at 5:38 PM, Diogo Salaberri <[email protected]> wrote:
>
> Hi..
>
> If you want to use localhost, try using "http://10.0.2.2" instead of
> localhost on the URL. Because internally android uses localhost for the
> emulator.
> Verify your URL and good luck.
>
> Bye
>
> --
> Atenciosamente;
> Diogo Bonoto Salaberri
> Bacharel em Ciência da Computação - UFPel
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
--
Thanks & Regards
Rakesh Kumar Jha
Software Developer
Symphony Services Corp (India) Pvt Ltd
Bangalore
(O) +918030274295
(R) +919886336619
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en