I have a JSON of the following format:
[{"fingerprint":"[79,0,0,0,18,0,0,0,18,0,0,0,19,0,0,0,23,0,0,0,40,0,0,0,42,0,0,0,63,0,0,0,68,0,0,0,71,0,....]"}]
I have been trying to extract the byte array from it using the following:
JSONFingerprint fingerprintData = gson.fromJson(obj, JSONFingerprint.class);
Where JSONFingerprint is:
public class JSONFingerprint { byte[] fingerprint; public byte[] getfingerprintData() { return fingerprint; } }
I have been getting this error:
Exception in thread "Thread-0" com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:176) at com.google.gson.Gson.fromJson(Gson.java:795) at com.google.gson.Gson.fromJson(Gson.java:859) at com.google.gson.Gson.fromJson(Gson.java:832)
Does anybody have any ideas??