Sorry for some mistakes , it should be code , message instead of a,b
On Wed, Sep 9, 2009 at 9:51 PM, Alok <[email protected]> wrote:
>
> Hi guys , i am using JSON to send data to server and fetching response
> back and using it .
> Now what i want to do ideally is create an object of a class whose
> members name is key and member value is value for a JSON object
> Example
>
> class MyClass
> {
> string code;
> string message;
> public abc()
> {
> a = null;
> b = null;
> }
> }
> func()
> {
> MyClass myClassObj = new MyClass();
> myClassObj.a = "hello";
> myClassObj.a = "hey";
> JSONObject jObj = new JSONObject();
>
> Some way to put the myClassObj in JSONObject and send it to server.
>
> Now server gives response as say
> {"error":{"null"},"result":{"message":"success","code":
> 200,"data":"13123131"},"id":"ada"}
> On retreival i should be able to assign JSONObject to MyClass object
> and all values such as code , message should be automatically
> retrievable
>
> }
>
> I have seen some dot net examples whering serialization /
> deserialization has been done to objects . How can i do it here?
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---