Top "Gson" questions

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

Gson deserialization of List<String> into realmList<RealmString>

I'm using retrofit with gson to deserialize my json into realm objects. This works very well for the most part. …

java android gson realm
Convert results of SQLite Cursor to my object

I've executed some queries on my SQLite DB on Android. Main instruction used is this: Cursor cursor = myDB.rawQuery(select, …

android cursor gson pojo
Force GSON to use specific constructor

public class UserAction { private final UUID uuid; private String userId; /* more fields, setters and getters here */ public UserAction(){ this.uuid = …

java constructor gson deserialization
Gson handle object or array

I've got the following classes public class MyClass { private List<MyOtherClass> others; } public class MyOtherClass { private String name; } …

gson
How to use Gson to serialize objects in android?

I want to send 2 objects to Java server from Android client using socket (as I am developing a Remote PC). …

java android json gson jsonserializer
GSON Case-Insensitive Enum Deserialization

I have an enum: enum Type { LIVE, UPCOMING, REPLAY } And some JSON: { "type": "live" } And a class: class Event { Type …

java gson json-deserialization
Using Gson with a path

Using a simple Json file e.g: {"menu": { "id": "file", "value": "File", "popup": { "menuitem": [ {"value": "New", "onclick": "CreateNewDoc()"}, {"value": "Open", "…

java json gson jsonpath
Cannot resolve import com.google.api.client.json.gson.GsonFactory

Am trying to use the GsonFactory class in my app: StudentApi.Builder builder = new StudentApi.Builder(AndroidHttp.newCompatibleTransport(), new GsonFactory(), …

android android-studio gson google-api-java-client
Fortify error on JSON Injection in Java

I am getting SUBSCRIPTION_JSON from client which I am converting it to String and then setting it to Model …

java json security gson fortify
only classes are allowed on the left hand side of a class literal

I know a lot of similar questions here in StackOverflow, but nothing solved mine. I have a generic data class: …

android generics gson kotlin data-class