I want to create and write jsonarray like in this link http://api.learn2crack.com/android/jsonos/. I researched but I could not find example that satisfy me.
I know how I write as JsonString, for example:
string jsonstring = new System.Web.Script.Serialization.JavaScriptSerializer().Serialize(obj);
But I have a array in asp.net and I want to write that array as JSONarray like this
{ "android":
[
{ "ver": "1.5", "name": "Cupcake", "api": "API level 3" },
{ "ver": "1.6", "name": "Donut", "api": "API level 4" }
]
}
JavaScriptSerializerto serialize an object into JSON. Or, if you're using MVC, you can return aJson()result. Or, with WebAPI, just return the object being serialized. There are lots of ways to do this. Where are you stuck?