Deserializing JSON data in Mono

2019-06-25 15:55发布

问题:

Is there an easy way to deserialize a simple JSON string into a .NET object when using Monodroid? System.Json only provides serialization (no deserialization) and the various third party libs I've tried were all causing problems with Mono/Monodroid. Thank you.

回答1:

fastJSON suits the bill. Grab the required files (Getters.cs, JSON.cs, JsonParser.cs, JsonSerializer.cs, SafeDictionary.cs) and embed them in your project and use it. It doesn't use any fancy .NET specific class so it should work with MonoDroid or Silverlight.