I want to parse this JSON string using Gson
{"name":"name","type":["a","b","c"]}
is it possible?
1st attr String -> String;
2nd attr String -> Array< String >
Thanks for any helps.
edit:i mean 1 attribut return a string as “name” and 2nd attribut return a Array. Like in this example http://json.parser.online.fr/ Samples Johndo , they have parsed “ID” as “ID”, “hobbies” as Array of “reading”, “cinema”.
But i want to do it as Javacode. Given a String like above, and parse an attr(a String) with an accordingly instance.
Following is an example of using Gson to bind the example JSON to a matching data structure.