Questions tagged [android-gson]

GSON (A Java serialization library to convert Java Objects into JSON and back) to fetch and parse JSON into Java Models for Android

1
vote
1answer
21 views

Gson serialization error with val in kotlin

I am using Gson v2.8.2 and Retrofit v2.3.0 and I have two classes, Answer.kt:open class Answer(@SerializedName("answer")var text: String,val id: Int)and ...
0
votes
2answers
45 views

How to retrieve jsonObject inside jsonArray using GSON in android

I am retrieving data from API and accessing the data using GSON. I have an array of data coming from API and it also contains an object in it.Data Example:{"data": [{"id"...
0
votes
0answers
56 views

GSON with corrupt json data

java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Object.hashCode()' on a null object referenceat libcore.reflect.TypeVariableImpl.hashCode(TypeVariableImpl.java:47)at ...
0
votes
1answer
20 views

Store and fetch a 2-D List of different sub-classes to Google Firebase

I have been building a multiplayer checker game for my class project.The below code is in Room class because every game should have a checkerboard.I converted to 2D List because Firebase does not ...
0
votes
1answer
16 views

Gson Request in RecyclerView

I want to set the response data to the layout. i success to get the response.How can i set the response data to the particular fields in recyclerview?How can i set container_id,title,description,tag?...
1
vote
2answers
28 views

java.lang.IllegalArgumentException: Parameter specified as non-null is null while parsing JSON to kotlin Data class

After kotlin being the first language for android, I have devoted myself into it. With a little progress over the days I have been migrating my existing knowledge to kotlin. Recently, I am learning ...
1
vote
1answer
53 views

Gson Post Method

How can I use params for POST the request and GET response?. I have two Model class. Each had a phone variable. How can i post without collapse? how to print the json file in logcat?Dependencies :...
-1
votes
2answers
37 views

Converting json (GSON) object to json array, put into list [closed]

My server returns JSON like this:{"name": "test","enabled": true}Which I read in as a string:String json=<get server response here>;// Get json as objectGroup group=new ...
0
votes
1answer
24 views

How to get Response before mapping to model using Retrofit 2.0.2 Android

I am having a problem using retrofit library While getting response i want to check response code before mapping to my class
1
vote
3answers
74 views

How to store nested JSON Array into a Model

Hello so I have a model called Job. This model collects everything about a specific job. But the way the database relations are layed out means that when I return the job details I get a cargo array ...
0
votes
1answer
34 views

Custom Gson request and response in post method

What have I done wrong?. How can i resolve this?. Please explain why this error occur. if it is run successfully what is my response?MainActivity : public class MainActivity extends ...
1
vote
1answer
29 views

How to pass a parameter using post method and get response from url and display it in android using gson and volley?

I would like to pass 2 parameters using POST method and get that response from API developed using php. I would like to use GSON and Volley for it.I have written one method and calling it in ...
0
votes
1answer
53 views

Gson deserialise - avoid wrapper class

I am trying to deserialize the following JSON using Gson in Kotlin.{"things": [{"name": "Thing1"},{"name": "Thing2"}}}Now I currently have 2 classes I'm ...
2
votes
0answers
31 views

How to serialize and handle dynamic JSON keys?

I have to deal with an API with many nested dynamic JSON keys with a lot of nesting.My Json Response is like that:{"success": true,"data": {"infoArr": {"868.111": {"...
1
vote
1answer
43 views

Gson and a comma in the last item of an array

I have this JSON{id: 142,fields: [{ fieldId: 50, value: 0 },{ fieldId: 51, value: 0 },{ fieldId: 52, value: 0 }, // <--- Notice the comma]}As you can see, there is a ...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,