gson Questions

3

Solved

I use jQuery DataTables and get this warning message: DataTables warning: table=userTable - Invalid JSON response A servlet fetch users from MySQL which I want to display in a jQuery Datatable...
Melamine asked 7/11, 2015 at 11:26

3

Solved

Crashes in Firebase Crashlytics appear with a note how to fix a problem: Fatal Exception: java.lang.IllegalStateException: TypeToken must be created with a type argument: new TypeToken<...>()...
Boiardo asked 11/5, 2023 at 7:7

3

Solved

Application crash when I try to insert list of Songs into Playlist class.I am using new Android studio version Flamingo and type coverters for converting list of model class. This is my Converter c...
Sagerman asked 30/8, 2023 at 10:37

3

Solved

I have a org.json.JSONObject object. What's the easiest way to create a gson.JsonObject object from it? Thanks
Giltzow asked 6/8, 2015 at 22:29

5

How do I remove some fields with a specified name from a JSON string recursively ? For example, I want to remove the field "secondName" from the following JSON: INPUT: { "name" : "abc", "secon...
Spirant asked 9/11, 2018 at 11:59

4

Solved

I'm trying to follow a tutorial about Android application. I'm using an dependency Fuel (which has a dependency to com.google.Gson deserializer). But Gson() is not imported by IDE. I've tried to s...
Isiahisiahi asked 17/8, 2019 at 17:3

9

Solved

I am facing a weird issue in the release build of the app. Here's my exception Fatal Exception: java.lang.NullPointerException` throw with null exception in.hopq.hopq.authentication.models.AppUpda...
Isoelectronic asked 15/5, 2019 at 5:13

3

Solved

By default Gson uses fields as a basis for it's serialization. Is there a way to get it to use accessors instead?
Thurber asked 8/7, 2012 at 17:39

10

I have json object with arbitary values inside. And I want to deserialize it in a Map. Everything is ok except converting integers to a doubles. See example: {"id":1, "inner_obj":{"key":"value","n...
Mugwump asked 13/6, 2013 at 15:7

6

Solved

I'm retrieving a json and when I convert it to List using gson, the app crashes. The proguard is on and the problem is there. fun getQuestions(): List<Question>? { val json = getQuestionsJso...
Recognition asked 3/2, 2022 at 10:36

3

I am dealing with a situation where I have polymorphic classes that I need to deserialize. Class Pen{ String name; List<Animal> animals; } //Animal can be an interface or parent class: I ...
Agrarian asked 2/2, 2016 at 19:16

17

Solved

What is this error ? How can I fix this? My app is running but can't load data. And this is my Error: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $ This is my f...
Frizzle asked 7/10, 2016 at 13:46

7

Solved

I have some problems with implementation of Json Deserialization in my Android application (with Gson library) I've made class like this public class MyJson<T>{ public List<T> posts;...
Berlioz asked 23/8, 2013 at 7:36

1

In my java application i was using REST API that returned data in JSON format, and noticed that this particular API formatted it's dates in a peculiar way: "Nov 1, 2019" , But problem is that the a...
Ling asked 4/11, 2019 at 6:12

9

Solved

I'm trying to follow Retrofit's 2 tutorial, but on this part of the code there is a GsonConverterFactory that displays error Cannot resolve symbol: public class ServiceGenerator { public static ...
Casillas asked 23/10, 2015 at 14:9

24

Solved

I have this method: public static Object parseStringToObject(String json) { String Object = json; Gson gson = new Gson(); Object objects = gson.fromJson(object, Object.class); parseConfigFromO...
Martian asked 9/2, 2015 at 20:24

5

I am having a hard time with GSON. I have a simple JSON that I want to deserialize to a Map<String,Object>. It's really intuitive to me that 123 should be parsed as an int (or long), 123.4 ...
Aloisia asked 24/7, 2014 at 6:44

3

Solved

When I use buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } everything works perfectly. But if change...
Rhodian asked 21/7, 2020 at 13:8

6

Solved

I have a class called Game: public class Game { private String name; private int id; private GameFields[] gameFields; @Expose(deserialize = false) public ArrayList<Player> players = new...
Ruyter asked 27/6, 2022 at 8:59

12

Solved

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, "language":null, "title":"JOHN", "url"...
Octopus asked 7/3, 2012 at 9:24

15

Solved

I want to be able to access properties from a JSON string within my Java action method. The string is available by simply saying myJsonString = object.getJson(). Below is an example of what the str...
Phyle asked 6/11, 2009 at 14:54

8

Solved

I need send a json to my webservice, json is: { "Sala": { "usuario": "%@", "adversario": "%@", "atualizacao": "%@", "device": "%@", "device_tipo": "ios" } } . I'm trying do it using Retr...
Chillon asked 15/12, 2014 at 13:36

4

Solved

How can I parse JSON to model with enum? Here is my enum class: enum class VehicleEnumEntity(val value: String) { CAR("vehicle"), MOTORCYCLE("motorcycle"), VAN("van"), MOTORHOME("motorhome"),...
Dialogue asked 7/8, 2017 at 18:18

6

Solved

I have an object with the following attributes. private final String messageBundle; private final List<String> messageParams; private final String actionBundle; private final Map<String, ...
Cartel asked 28/8, 2012 at 14:20

20

Solved

I'm migrating from using Volley to Retrofit, I already have gson class that I used before for converting JSONObject response to a object that implements gson annotations. When I'm trying to make a ...
Kidder asked 3/9, 2015 at 5:17

© 2022 - 2024 — McMap. All rights reserved.