Top "Gson" questions

Gson is Google's open-source library for serializing and deserializing Java objects to/from JSON.

Android Studio: Add jar as library?

I'm trying to use the new Android Studio but I can't seem to get it working correctly. I'm using the …

android gradle android-gradle-plugin gson dependency-management
Representing null in JSON

What is the preferred method for returning null values in JSON? Is there a different preference for primitives? For example, …

json jackson gson
GSON throwing "Expected BEGIN_OBJECT but was BEGIN_ARRAY"?

I'm trying to parse a JSON string like this one [ { "updated_at":"2012-03-02 21:06:01", "fetched_at":"2012-03-02 21:28:37.728840", "description":null, "…

java android gson
Converting JSON data to Java object

I want to be able to access properties from a JSON string within my Java action method. The string is …

java json jackson gson
JSON parsing using Gson for Java

I would like to parse data from JSON which is of type String. I am using Google Gson. I have: …

java json gson
Google Gson - deserialize list<class> object? (generic type)

I want to transfer a list object via Google Gson, but I don't know how to deserialize generic types. What …

java json generics gson
How can I convert JSON to a HashMap using Gson?

I'm requesting data from a server which returns data in the JSON format. Casting a HashMap into JSON when making …

java json dictionary hashmap gson
"Expected BEGIN_OBJECT but was STRING at line 1 column 1"

I have this method: public static Object parseStringToObject(String json) { String Object = json; Gson gson = new Gson(); Object objects = gson.…

java json parsing gson
Gson: How to exclude specific fields from Serialization without annotations

I'm trying to learn Gson and I'm struggling with field exclusion. Here are my classes public class Student { private Long …

java json serialization gson
Gson: Directly convert String to JsonObject (no POJO)

Can't seem to figure this out. I'm attempting JSON tree manipulation in GSON, but I have a case where I …

java json gson