Saturday, November 17, 2012

[android-developers] Re: regarding android json request

nageswara rao Rajana wrote:
> Hi,
>
> JSONObject holder = new JSONObject();
>
> holder.put("Key1","Value1");
> holder.put("Key2","Value2");
> holder.put("Key3","Value3");
> holder.put("Key4","Value4");
>
> String jsonrequest = holder.toString();
>
>
> but while sending request the format is changing to
> {"Key2":"Value2","Key3":"Value3","Key4":"Value4","Key1":"Value1"}
>
> but i want this
> format {"Key1":"Value1","Key2":"Value2","Key3":"Value3","Key4":"Value4"}.
>
>
> so please help me how can i achieve this.
>
>
> Thanking you,
> nagu.

see www.json.org:

"An object is an unordered
set of name/value pairs.
An object begins with
{ (left brace) and ends
with } (right brace). Each
name is followed by :
(colon) and the name/
value pairs are separated
by , (comma)."

pskink

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate