JSONconvert.Serializeobject Always Return {} in Xamarinforms

JsonConvert.SerializeObject always return {} in XamarinForms

I tried setting up emulator on a fast machine and the serialize works! So it means it doesn't work when i run it on live player using my android phone. I will set this as an answer for now. if someone else posted on how to make it work on live player, i will set it as the correct answer

Newtonsoft.JSON serializeobject returns empty JSON string

It appears that Xamarin Live Player has some issues with the serializer. I tried plugging my phone via USB and it works!

Newtonsoft.Json deserialize object in Xamarin iOS project

Just got back to this problem. In case anyone‘s wondering: Turns out the Xamarin Live Player I’ve recently had to use has some problems with Json.NET. (https://developer.xamarin.com/guides/cross-platform/live/limitations/)

I knew it had to be something stupid... Well maybe I can save someone else some time!

Javascript Escape from Json.Net

I found a nice one-liner solution, but it has only been in the framework since 4.0. Would be nice to have something similar in Json.NET I can use on < 4.0 projects.

HttpUtility.JavaScriptStringEncode example:

HttpUtility.JavaScriptStringEncode(@"hi bud's  \no way\")

Returns: hi bud\u0027s \\no way\\

Newtonsoft.Json works in Unity Editor but not on mobile devices

I Installed the Newtonsoft.Json using the NuGet and it appears in the references.

Newtonsoft.Json from NuGet is not supported in Unity3d il2cpp targets, like mobile devices. Use a Newtonsoft.Json fork from the asset store, like this one.



Related Topics



Leave a reply



Submit