The problem is that in the JSON data, the list of sensor data is named
logdata, but there is no field named
logdata in your
Datalist class (by default, when deserializing, Gson will try and match the JSON attribute name with a Java field name).
Use the
SerializedName annotation to indicate that the annotated field is for the JSON data named
logdata.
For example (using your code from another topic):