I have a problem. I want to pass String array to javascript, but this is impossible, so I want to convert String array to json and send it to java script. How can I do that?
4 Answers
A popular solution for Android would be the use of GSON: https://code.google.com/p/google-gson/
The package provides simple toJson and fromJson methods on its main converter object, so you get there quite easily. Alternatives like Jackson often require some additional preparation of the converted objects.
Comments
You could try using FlexJSON for Serialization/Deserialization of objects. It has a nice and easy tutorial accessible on the website and is flexible in its usage.