Json parsing in skyscanner pricing api - android

I started working with sky-scanner API using volley on Android. I am able to poll the response from the API, however I have no clue how to parse the json which is sent in response, please see json below. The json response is very big, I have never worked with such responses before thus have no idea how can I handle this.
Can someone please help me figure this out? There is no sample implementation done by anyone for skyscanner for android.
JSON response to be parsed to get price, agents, flight number, carrier, duration of flight, image URL of flight.
{
"SessionKey": "97d1_ecilpojl_A",
"Query": {
"Country": "IN",
"Currency": "INR",
"Locale": "en-us",
"Adults": 1,
"Children": 0,
"Infants": 0,
"OriginPlace": "12627",
"DestinationPlace": "11712",
"OutboundDate": "2016-10-09",
"LocationSchema": "Default",
"CabinClass": "Economy",
"GroupPricing": false
},
"Status": "UpdatesComplete",
"Itineraries": [
{
"OutboundLegId": "12627-1610091100-AI-1-11712-1610091515",
"PricingOptions": [
{
"Agents": [
1963108
],
"QuoteAgeInMinutes": 5,
"Price": 19391.08,
"DeeplinkUrl": "/deeplink/v2?_cje=9CRwSnJAYX4dZyvkLfQf7nyRn0MxGbhiKjD2KHvGPF9n99euZVUDq%2bzBrzQGTfTH&url=http%3a%2f%2fwww.apideeplink.com%2ftransport_deeplink%2f4.0%2fIN%2fen-us%2fINR%2fat24%2f1%2f12627.11712.2016-10-"
},
{
"Agents": [
2176206
],
"QuoteAgeInMinutes": 5,
"Price": 20190,
"DeeplinkUrl": "/deeplink/v2?_cje=9CRwSnJAYX4dZyvkLfQf7nyRn0MxGbhiKjD2KHvGPF9n99euZVUDq%2bzBrzQGTfTH&url=http%3a%2f%2fwww.apideeplink.com%2ftransport_deeplink%2f4.0%2fIN%2fen-us%2fINR%2fcpin%2f1%2f12627.11712.2016-10-"
},
{
"Agents": [
4575202
],
"QuoteAgeInMinutes": 5,
"Price": 20315,
"DeeplinkUrl": "/deeplink/v2?_cje=9CRwSnJAYX4dZyvkLfQf7nyRn0MxGbhiKjD2KHvGPF9n99euZVUDq%2bzBrzQGTfTH&url=http%3a%2f%2fwww.apideeplink.com%2ftransport_deeplink%2f4.0%2fIN%2fen-us%2fINR%2fyatr%2f1%2f12627.11712.2016-10-"
},
{
"Agents": [
4056270
],
"QuoteAgeInMinutes": 5,
"Price": 20457.92,
"DeeplinkUrl": "/deeplink/v2?_cje=9CRwSnJAYX4dZyvkLfQf7nyRn0MxGbhiKjD2KHvGPF9n99euZVUDq%2bzBrzQGTfTH&url=http%3a%2f%2fwww.apideeplink.com%2ftransport_deeplink%2f4.0%2fIN%2fen-us%2fINR%2ftpin%2f1%2f12627.11712.2016-10-"
},
{
"Agents": [
1943172
],
"QuoteAgeInMinutes": 5,
"Price": 20876,
"DeeplinkUrl": "/deeplink/v2?_cje=9CRwSnJAYX4dZyvkLfQf7nyRn0MxGbhiKjD2KHvGPF9n99euZVUDq%2bzBrzQGTfTH&url=http%3a%2f%2fwww.apideeplink.com%2ftransport_deeplink%2f4.0%2fIN%2fen-us%2fINR%2fakbt%2f1%2f12627.11712.2016-10-"
},
{
"Agents": [
3987150
],
"QuoteAgeInMinutes": 5,
"Price": 20888.5,
"DeeplinkUrl": "/deeplink/v2?_cje=9CRwSnJAYX4dZyvkLfQf7nyRn0MxGbhiKjD2KHvGPF9n99euZVUDq%2bzBrzQGTfTH&url=http%3a%2f%2fwww.apideeplink.com%2ftransport_deeplink%2f4.0%2fIN%2fen-us%2fINR%2ft2in%2f1%2f12627.11712.2016-10-09%2fair%2ftrava%2fflights%3fitinerary%3dflight%7c-32672%7c446%7c12627%7c2016-10-09T11%3a00%7c10957%7c2016-10-09T12%3a35%3bflight%7c-"
},
{
"Agents": [
4035534
],
"QuoteAgeInMinutes": 5,
"Price": 20959.41,
"DeeplinkUrl": "/deeplink/v2?_cje=9CRwSnJAYX4dZyvkLfQf7nyRn0MxGbhiKjD2KHvGPF9n99euZVUDq%2bzBrzQGTfTH&url=http%3a%2f%2fwww.apideeplink.com%2ftransport_deeplink%2f4.0%2fIN%2fen-us%2fINR%2ftgin%2f1%2f12627.11712.2016-10-"
},
{
"Agents": [
1964238
],
"QuoteAgeInMinutes": 5,
"Price": 21207.92,
"DeeplinkUrl": "/v2?_cje=9CRwSnJAYX4dZyvkLfQf7nyRn0MxGbhiKjD2KHvGPF9n99euZVUDq%2bzBrzQGTfTH&url=http%3a%2f%2fwww.apideeplink.com%2ftransport_deeplink%2f4.0%2fIN%2fen-us%2fINR%2fatin%2f1%2f12627.11712.2016-10-"
},
{
"Agents": [
4060673
],
"QuoteAgeInMinutes": 5,
"Price": 21782,
"DeeplinkUrl": "/deeplink/v2?_cje=9CRwSnJAYX4dZyvkLfQf7nyRn0MxGbhiKjD2KHvGPF9n99euZVUDq%2bzBrzQGTfTH&url=http%3a%2f%2fwww.apideeplink.com%2ftransport_deeplink%2f4.0%2fIN%2fen-us%2fINR%2ftrea%2f1%2f12627.11712.2016-10-"
},
{
"Agents": [
3911604
],
"QuoteAgeInMinutes": 5,
"Price": 21782,
"DeeplinkUrl": "/deeplink/v2?_cje=9CRwSnJAYX4dZyvkLfQf7nyRn0MxGbhiKjD2KHvGPF9n99euZVUDq%2bzBrzQGTfTH&url=http%3a%2f%2fwww.apideeplink.com%2ftransport_deeplink%2f4.0%2fIN%2fen-us%2fINR%2fsast%2f1%2f12627.11712.2016-10-"
},
{
"Agents": [
2391001
],
"QuoteAgeInMinutes": 5,
"Price": 21782,
"DeeplinkUrl": "/deeplink/v2?_cje=9CRwSnJAYX4dZyvkLfQf7nyRn0MxGbhiKjD2KHvGPF9n99euZVUDq%2bzBrzQGTfTH&url=http1.prod_0148f8394d6c2b79a407121f74dce6e1%26commercial_filters%3dfalse%26q_datetime_utc%3d2016-10-02T12%3a09%3a13"
},
{
"Agents": [
4260937
],
"QuoteAgeInMinutes": 5,
"Price": 22217.64,
"DeeplinkUrl": "/deeplink/v2?_cje=9CRwSnJAYX4dZyvkLfQf7nyRn0MxGbhiKjD2KHvGPF9n99euZVUDq%2bzBrzQGTfTH&url=http%3a%2f%2fwww.apideeplink.com%2ftransport_deeplink%2f4.0%2fIN%2fen-us%2fINR%2fviai%2f1%2f12627.11712.2016-10-"
},
{
"Agents": [
3929744
],
"QuoteAgeInMinutes": 5,
"Price": 22417.66,
"DeeplinkUrl": "deeplink/v2?_cje=9CRwSnJAYX4dZyvkLfQf7nyRn0MxGbhiKjD2KHvGPF9n99euZVUDq%2bzBrzQGTfTH&url=http32672%26passengers%3d1%2c0%2c0%26channel%3ddataapi%26cabin_class%3deconomy%26facilitated%3dfalse%26ticket_price%3d22417.66%26is_npt%3dfalse%26is_multipart%3dfal
}
],
"BookingDetailsLink": {
"Uri": "/apiservices/pricing/v1.0/97d115d901944a33a4084a4a3170905f_ecilpojl_A1EA190098863E15CE039BCA9C3B1D16/booking",
"Body": "OutboundLegId=12627-1610091100-AI-1-11712-1610091515&InboundLegId=",
"Method": "PUT"
}
},
{
"OutboundLegId": "12627-1610090820-9W,AI-1-11712-1610091515",
"PricingOptions": [
{
"Agents": [
1963108
],
"QuoteAgeInMinutes": 5,
"Price": 37113.61,
"DeeplinkUrl": "/v2?_cje=9CRwSnJAYX4dZyvkLfQf7nyRn0MxGbhiKjD2KHvGPF9n99euZVUDq%2bzBrzQGTfTH&url=http%3a%2f%2fwww.apideeplink.com%2ftransport_deeplink%2f4.0%2fIN%2fen-us%2fINR%2fat24%2f1%2f12627.11712.2016-10-09%2fair%2ftrava%2fflights%3fitinerary%3dflight%7c-32177%7c2367%7c12627%7c2016-"
},
{
"Agents": [
2176206
],
"QuoteAgeInMinutes": 5,
"Price": 38374,
"DeeplinkUrl": "/v2?_cje=9CRwSnJAYX4dZyvkLfQf7nyRn0MxGbhiKjD2KHvGPF9n99euZVUDq%2bzBrzQGTfTH&url=http%3a%2f%2fwww.apideeplink.com%2ftransport_deeplink%2f4.0%2fIN%2fen-us%2fINR%2fcpin%2f1%2f12627.11712.2016-10-09%2fair%2ftrava%2fflights%3fitinerary%3dflight%7c-32177%7c2367%7c12627%7c2016-10-09T08%3a20%7c10957%7c2016-10-09T09%3a45%3bflight%7c-"
},
{
"Agents": [
4056270
],
"QuoteAgeInMinutes": 5,
"Price": 38854.31,
"DeeplinkUrl": "http://partners.api.skyscanner.net/apiservices/deeplink/v2?_cje=9CRwSnJAYX4dZyvkLfQf7nyRn0MxGbhiKjD2KHvGPF9n99euZVUDq%2bzBrzQGTfTH&url=http%3a%2f%2fwww.apideeplink.com%2ftransport_deeplink%2f4.0%2fIN%2fen-us%2fINR%2ftpin%2f1%2f12627.11712.2016-10-"
},
{
"Agents": [
1964238
],
"QuoteAgeInMinutes": 5,
"Price": 39604.31,
"DeeplinkUrl": "/deeplink/v2?_cje=9CRwSnJAYX4dZyvkLfQf7nyRn0MxGbhiKjD2KHvGPF9n99euZVUDq%2bzBrzQGTfTH&url=http%3a%2f%2fwww.apideeplink.com%2ftransport_deeplink%2f4.0%2fIN%2fen-us%2fINR%2fatin%2f1%2f12627.11712.2016-10-"
},
{
"Agents": [
2627411
],
"QuoteAgeInMinutes": 5,
"Price": 39932.95,
"DeeplinkUrl": "/deeplink/v2?_1.prod_8365f3bbc5ef11ab38406bb350796374%26commercial_filters%3dfalse%26q_datetime_utc%3d2016-10-02T12%3a09%3a12"
},
{
"Agents": [
2042574
],
"QuoteAgeInMinutes": 5,
"Price": 43940.34,
"DeeplinkUrl": "/deeplink/v2?32672%26passengers%3d1%2c0%2c0%26channel%3ddataapi%26cabin_class%3deconomy%26facilitated%3dfalse%26ticket_price%3d43940.34%26is_npt%3dfalse%26is_multipart%3dfalse%26client_id%3dskyscanner_b2b%26request_id%3dd4cc5531-1a4b-4c76-a063-447e7a8baeea%26deeplink_ids%3dap-northeast-1.prod_0b228b45aaf97f3276f40ee4109e8faf%26commercial_filters%3dfalse%26q_datetime_utc%3d2016-10-02T12%3a09%3a13"
}
],
"BookingDetailsLink": {
"Uri": "/apiservices/pricing/v1.0/97d115d901944a33a4084a4a3170905f_ecilpojl_A1EA190098863E15CE039BCA9C3B1D16/booking",
"Body": "OutboundLegId=12627-1610090820-9W,AI-1-11712-1610091515&InboundLegId=",
"Method": "PUT"
}
}
],
"Legs": [
{
"Id": "12627-1610091100-AI-1-11712-1610091515",
"SegmentIds": [
1,
2
],
"OriginStation": 12627,
"DestinationStation": 11712,
"Departure": "2016-10-09T11:00:00",
"Arrival": "2016-10-09T15:15:00",
"Duration": 255,
"JourneyMode": "Flight",
"Stops": [
10957
],
"Carriers": [
841
],
"OperatingCarriers": [
841
],
"Directionality": "Outbound",
"FlightNumbers": [
{
"FlightNumber": "446",
"CarrierId": 841
},
{
"FlightNumber": "433",
"CarrierId": 841
}
]
},
{
"Id": "12627-1610090820-9W,AI-1-11712-1610091515",
"SegmentIds": [
3,
2
],
"OriginStation": 12627,
"DestinationStation": 11712,
"Departure": "2016-10-09T08:20:00",
"Arrival": "2016-10-09T15:15:00",
"Duration": 415,
"JourneyMode": "Flight",
"Stops": [
10957
],
"Carriers": [
471,
841
],
"OperatingCarriers": [
471,
841
],
"Directionality": "Outbound",
"FlightNumbers": [
{
"FlightNumber": "433",
"CarrierId": 841
},
{
"FlightNumber": "2367",
"CarrierId": 471
}
]
}
],
"Segments": [
{
"Id": 1,
"OriginStation": 12627,
"DestinationStation": 10957,
"DepartureDateTime": "2016-10-09T11:00:00",
"ArrivalDateTime": "2016-10-09T12:35:00",
"Carrier": 841,
"OperatingCarrier": 841,
"Duration": 95,
"FlightNumber": "446",
"JourneyMode": "Flight",
"Directionality": "Outbound"
},
{
"Id": 2,
"OriginStation": 10957,
"DestinationStation": 11712,
"DepartureDateTime": "2016-10-09T13:40:00",
"ArrivalDateTime": "2016-10-09T15:15:00",
"Carrier": 841,
"OperatingCarrier": 841,
"Duration": 95,
"FlightNumber": "433",
"JourneyMode": "Flight",
"Directionality": "Outbound"
},
{
"Id": 3,
"OriginStation": 12627,
"DestinationStation": 10957,
"DepartureDateTime": "2016-10-09T08:20:00",
"ArrivalDateTime": "2016-10-09T09:45:00",
"Carrier": 471,
"OperatingCarrier": 471,
"Duration": 85,
"FlightNumber": "2367",
"JourneyMode": "Flight",
"Directionality": "Outbound"
}
],
"Carriers": [
{
"Id": 841,
"Code": "AI",
"Name": "Air India",
"ImageUrl": "http://s1.apideeplink.com/images/airlines/AI.png",
"DisplayCode": "AI"
},
{
"Id": 471,
"Code": "9W",
"Name": "Jet Airways",
"ImageUrl": "http://s1.apideeplink.com/images/airlines/9W.png",
"DisplayCode": "9W"
}
],
"Agents": [
{
"Id": 1963108,
"Name": "Mytrip",
"ImageUrl": "http://s1.apideeplink.com/images/websites/at24.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": true,
"BookingNumber": "+448447747881",
"Type": "TravelAgent"
},
{
"Id": 2176206,
"Name": "Cheapticket.in",
"ImageUrl": "http://s1.apideeplink.com/images/websites/cpin.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": false,
"Type": "TravelAgent"
},
{
"Id": 4575202,
"Name": "Yatra.com",
"ImageUrl": "http://s1.apideeplink.com/images/websites/yatr.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": true,
"BookingNumber": "18001029900",
"Type": "TravelAgent"
},
{
"Id": 4056270,
"Name": "Tripsta",
"ImageUrl": "http://s1.apideeplink.com/images/websites/tpin.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": true,
"Type": "TravelAgent"
},
{
"Id": 1943172,
"Name": "AkbarTravels.com",
"ImageUrl": "http://s1.apideeplink.com/images/websites/akbt.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": true,
"Type": "TravelAgent"
},
{
"Id": 3987150,
"Name": "Travel2be",
"ImageUrl": "http://s1.apideeplink.com/images/websites/t2in.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": true,
"Type": "TravelAgent"
},
{
"Id": 4035534,
"Name": "Travelgenio",
"ImageUrl": "http://s1.apideeplink.com/images/websites/tgin.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": true,
"Type": "TravelAgent"
},
{
"Id": 1964238,
"Name": "airtickets",
"ImageUrl": "http://s1.apideeplink.com/images/websites/atin.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": true,
"Type": "TravelAgent"
},
{
"Id": 4060673,
"Name": "Traveasy.co.in",
"ImageUrl": "http://s1.apideeplink.com/images/websites/trea.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": false,
"Type": "TravelAgent"
},
{
"Id": 3911604,
"Name": "Sastiticket.com",
"ImageUrl": "http://s1.apideeplink.com/images/websites/sast.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": false,
"Type": "TravelAgent"
},
{
"Id": 2391001,
"Name": "EaseMyTrip.com",
"ImageUrl": "http://s1.apideeplink.com/images/websites/emti.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": false,
"Type": "TravelAgent"
},
{
"Id": 4260937,
"Name": "via.com",
"ImageUrl": "http://s1.apideeplink.com/images/websites/viai.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": true,
"Type": "TravelAgent"
},
{
"Id": 3929744,
"Name": "Simplio",
"ImageUrl": "http://s1.apideeplink.com/images/websites/simp.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": false,
"Type": "TravelAgent"
},
{
"Id": 2627411,
"Name": "GotoGate",
"ImageUrl": "http://s1.apideeplink.com/images/websites/gtas.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": true,
"Type": "TravelAgent"
},
{
"Id": 2042574,
"Name": "Bravofly",
"ImageUrl": "http://s1.apideeplink.com/images/websites/bfin.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": true,
"Type": "TravelAgent"
},
{
"Id": 1882712,
"Name": "ebookers",
"ImageUrl": "http://s1.apideeplink.com/images/websites/a178.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": true,
"Type": "TravelAgent"
},
{
"Id": 4366985,
"Name": "Wegoby.com",
"ImageUrl": "http://s1.apideeplink.com/images/websites/wgby.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": false,
"Type": "TravelAgent"
},
{
"Id": 3291237,
"Name": "My Travel Genie",
"ImageUrl": "http://s1.apideeplink.com/images/websites/mtge.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": false,
"Type": "TravelAgent"
},
{
"Id": 3588558,
"Name": "Tripair",
"ImageUrl": "http://s1.apideeplink.com/images/websites/pein.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": false,
"Type": "TravelAgent"
},
{
"Id": 2834897,
"Name": "Air India",
"ImageUrl": "http://s1.apideeplink.com/images/websites/inda.png",
"Status": "UpdatesComplete",
"OptimisedForMobile": false,
"BookingNumber": "18001801407",
"Type": "Airline"
}
],
"Places": [
{
"Id": 12627,
"ParentId": 3462,
"Code": "IXL",
"Type": "Airport",
"Name": "Leh"
},
{
"Id": 10957,
"ParentId": 3401,
"Code": "DEL",
"Type": "Airport",
"Name": "New Delhi"
},
{
"Id": 11712,
"ParentId": 3424,
"Code": "GAY",
"Type": "Airport",
"Name": "Gaya"
},
{
"Id": 3462,
"ParentId": 170,
"Code": "IXL",
"Type": "City",
"Name": "Leh"
},
{
"Id": 3401,
"ParentId": 170,
"Code": "DEL",
"Type": "City",
"Name": "New Delhi"
},
{
"Id": 3424,
"ParentId": 170,
"Code": "GAY",
"Type": "City",
"Name": "Gaya"
},
{
"Id": 170,
"Code": "IN",
"Type": "Country",
"Name": "India"
}
],
"Currencies": [
{
"Code": "INR",
"Symbol": "₹",
"ThousandsSeparator": ",",
"DecimalSeparator": ".",
"SymbolOnLeft": true,
"SpaceBetweenAmountAndSymbol": false,
"RoundingCoefficient": 0,
"DecimalDigits": 2
}
]
}

If you are able to pull the json data then try using this js script:
Make sure to add jQuery
Change the value of the url variable with the session poll url you created
NOTE: Please take note that you will encounter cross origin error when you try to run this script here.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js">
( function( window, document, $ ){
var app = {};
app.init = function()
{
app.flightsGeo();
};
app.flightsGeo = function( )
{
// the session poll url you created
var url = 'http://business.skyscanner.net/apiservices/pricing/hk1/v1.0/<sessionKey>?apikey=<apikey>';
$.ajax({
type: "GET",
url: url,
dataType: 'json',
success: function( response ){
var itineraries = response.Itineraries;
var agents = response.Agents;
var legs = response.Legs;
var carriers = response.Carriers;
var places = response.Places;
$.each(itineraries, function( itineraryKey, itineraryVal ){
var inbound = app.getObjects( legs, 'Id', itineraryVal.InboundLegId),
inDepartureTime = inbound[0].Departure,
inArrivalTime = inbound[0].Arrival,
inDepartureDate = inbound[0].Departure,
inArrivalDate = inbound[0].Arrival,
inOrigin = app.getObjects( places, 'Id', inbound[0].DestinationStation),
inDestination = app.getObjects( places, 'Id', inbound[0].OriginStation),
inCarriers = app.getObjects( carriers, 'Id', inbound[0].OperatingCarriers[0]);
var outbound = app.getObjects( legs, 'Id', itineraryVal.OutboundLegId),
outDepartureTime = outbound[0].Departure,
outArrivalTime = outbound[0].Arrival,
outDepartureDate = outbound[0].Departure,
outArrivalDate = outbound[0].Arrival,
outOrigin = app.getObjects( places, 'Id', outbound[0].DestinationStation),
outDestination = app.getObjects( places, 'Id', outbound[0].OriginStation),
outCarriers = app.getObjects( carriers, 'Id', outbound[0].OperatingCarriers[0]);
var agent = app.getObjects( agents, 'Id', itineraryVal.PricingOptions[0].Agents[0]);
var price = itineraryVal.PricingOptions[0].Price.toFixed(2);
var permalink = itineraryVal.PricingOptions[0].DeeplinkUrl;
var time = itineraryVal.PricingOptions[0].QuoteAgeInMinutes;
// NEW FORMAT OF DATA
var data = {
agent : agent,
price : price,
time : time,
permalink : permalink,
inbound : {
time : {
departure : inDepartureTime,
arrival : inArrivalTime
},
date : {
departure : inDepartureDate,
arrival : inArrivalDate
},
station : {
origin : inOrigin,
destination : inDestination
},
carriers : inCarriers
},
outbound : {
time : {
departure : outDepartureTime,
arrival : outArrivalTime
},
date : {
departure : outDepartureDate,
arrival : outArrivalDate
},
station : {
origin : outOrigin,
destination : outDestination
},
carriers : outCarriers
}
};
// will display the NEW FORMAT OF DATA
console.log( data );
});
},
error: function( error ){
console.log( error );
}
});
};
app.displayData = function( data )
{
console.log( data );
};
app.getObjects = function(obj, key, val) {
var objects = [];
for (var i in obj) {
if (!obj.hasOwnProperty(i)) continue;
if (typeof obj[i] == 'object') {
objects = objects.concat(app.getObjects(obj[i], key, val));
} else
//if key matches and value matches or if key matches and value is not passed (eliminating the case where key matches but passed value does not)
if (i == key && obj[i] == val || i == key && val == '') { //
objects.push(obj);
} else if (obj[i] == val && key == ''){
//only add if the object is not already in the array
if (objects.lastIndexOf(obj) == -1){
objects.push(obj);
}
}
}
return objects;
};
$(document).ready( app.init );
return app;
})( window, document, jQuery );
</script>
P.S. I hope this will helps you the idea how to get the data you need.

I'll show a basic example of how to parse. Take the following sample JSON.
http://api.androidhive.info/contacts/
How to get the contacts list.
JSONObject jsonObj = new JSONObject("Your JSON String here");
JSONArray contacts = jsonObj.optJSONArray("contacts");
How to calculate the phone number
//Get first contact
JSONObject firstContact = contacts.optJSONObject(0);
JSONObject phone = firstContact.optJSONObject("phone");
String mobileNo = phone.optString("mobile");
Similarly you can apply this technique to your JSON.

Related

Handle custom response in Paging library 3 Android

I am new to the Paging 3 library in android kotlin. I want unlimited data. So I found the Paging 3 library helpful in my case. I used PagingSource to create a list. I am not using Room. I have multiple view in recyclerView. I am using PagingDataAdapter with diff util for my Recyclerview. I used the recommended tutorial for the Paging library from codelab and I succeeded without any problem.
Now I'm facing some problems in how to handle other data than matches
{
"status": {
"code": 200,
"message": "Matches found"
},
"data": {
"filters": {
"sortable_actions": [
{
"name": "asd",
"value": "sd",
"is_selected_filter": false
},
{
"name": "asd",
"value": "asd",
"is_selected_filter": false
}
],
"filter_actions": [
{
"name": "sdaf",
"display_name": "dafs",
"is_selected_filter": false
}
]
},
"cities": [
"Akora, Japan",
"Zurich, Switzerland"
],
"matches_count": {
"hot": 0,
"warm": 0,
"cool": 17
},
"matches": [
{
"id": "52832",
"type": "asdf",
"attributes": {
"name": "afd",
"pitch": "dsf",
"logo": "adsf",
"plan": "fd",
"country": "sdf",
"city": "faas",
}
},
{
"id": "52832",
"type": "asdf",
"attributes": {
"name": "",
"pitch": "",
"logo": "",
"plan": "",
"country": "",
"city": "",
}
},
{
"id": "52832",
"type": "",
"attributes": {
"name": "",
"pitch": "",
"logo": "",
"plan": "",
"country": "",
"city": "",
}
},
{
"id": "52832",
"type": "",
"attributes": {
"name": "",
"pitch": "",
"logo": "",
"plan": "",
"country": "",
"city": "",
}
}
]
}
}
can you please help me how to get filter and sorting data in my UI.

ObjectBox - DBException coming due to UID mismatching

I am using Objectbox as an ORM in my application and getting dbexception due to mismatching UID, when I added some extra properties in one of my entity. As I went through the documentation where it is mentioned that if we add or remove properties in your entities objectbox will take care of the changes. But it's not happening in my case. Please have a look at my log stash, entities and default.json once and let me know what could be the possible solution to resolve this issue.
ObjectBox version: v1.2.0
Logs
Caused by: io.objectbox.exception.DbException: Incoming entity ID 8:7509306813647547019 does not match existing UID 8172185837942255744
at io.objectbox.BoxStore.nativeCreate(Native Method)
at io.objectbox.BoxStore.<init>(BoxStore.java:187)
at io.objectbox.BoxStoreBuilder.build(BoxStoreBuilder.java:259)
at com.letsdogether.dogether.dagger.module.ObjectModule.<init>(ObjectModule.java:34)
at com.letsdogether.dogether.newDogetherHome.DogetherApplication.loadObjectsComponent(DogetherApplication.java:104)
at com.letsdogether.dogether.newDogetherHome.DogetherApplication.onCreate(DogetherApplication.java:79)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1018)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4969)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1559)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5750)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
Entities
Previously my entity looks like this:
#Entity
public class BookingItem {
private long id;
#Id(assignable = true)
private long priority;
private String date;
private String formattedAddress;
private String orderId;
private String type;
private String title;
private int seatCount;
private String pricePerPerson;
private String time;
private String day;
private String redirectUrl;
private String status;
private long experienceId;
private String shareableUrl;
private ToOne<Image> image;
private ToOne<FeedElement> feedElementToOne;
}
and my default.json looks like this:
{
"_note1": "KEEP THIS FILE! Check it into a version control system (VCS) like git.",
"_note2": "ObjectBox manages crucial IDs for your object model. See docs for details.",
"_note3": "If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.",
"entities": [
{
"id": "1:4340630284304338974",
"lastPropertyId": "8:4962045346664663063",
"name": "BaseExperience",
"properties": [
{
"id": "1:647607068638902600",
"name": "id"
},
{
"id": "2:2702040841419862055",
"name": "actualId"
},
{
"id": "3:3033280429430892352",
"name": "avgRating"
},
{
"id": "4:7218439493883955972",
"name": "customerReviewsCount"
},
{
"id": "5:80984715122814807",
"name": "pricePerPerson"
},
{
"id": "6:3883498391107289246",
"name": "title"
},
{
"id": "7:8998466498535731699",
"indexId": "1:1765637542740785127",
"name": "videoId"
},
{
"id": "8:4962045346664663063",
"indexId": "2:2040540235098101863",
"name": "feedToOneId"
}
],
"relations": []
},
{
"id": "2:7267925106594307597",
"lastPropertyId": "17:4933883640820962465",
"name": "BookingItem",
"properties": [
{
"id": "1:2843152350771579539",
"name": "id"
},
{
"id": "2:3864807135625693365",
"name": "priority"
},
{
"id": "3:2811475968058126998",
"name": "date"
},
{
"id": "4:5994267266359962076",
"name": "formattedAddress"
},
{
"id": "5:8101006061974386478",
"name": "orderId"
},
{
"id": "6:5927620191588993112",
"name": "type"
},
{
"id": "7:6885331133485554648",
"name": "title"
},
{
"id": "8:1499199287986398172",
"name": "seatCount"
},
{
"id": "9:2504021269483806060",
"name": "pricePerPerson"
},
{
"id": "10:7281235595111103399",
"name": "time"
},
{
"id": "11:6617722497399396474",
"name": "day"
},
{
"id": "12:2473985422221126897",
"name": "redirectUrl"
},
{
"id": "13:2904830306792476987",
"name": "status"
},
{
"id": "14:2181195403266779204",
"name": "experienceId"
},
{
"id": "15:3018070061889416768",
"name": "shareableUrl"
},
{
"id": "16:6444561946554419063",
"indexId": "3:1705820361334358507",
"name": "imageId"
},
{
"id": "17:4933883640820962465",
"indexId": "4:3744949801364672550",
"name": "feedElementToOneId"
}
],
"relations": []
},
{
"id": "3:160108942376228999",
"lastPropertyId": "6:8550232341754154098",
"name": "Feed",
"properties": [
{
"id": "1:1692860121377933562",
"name": "id"
},
{
"id": "2:8854384643059958161",
"name": "type"
},
{
"id": "3:7664556112391884481",
"name": "title"
},
{
"id": "4:5817245497381540954",
"name": "seeAll"
},
{
"id": "5:2317329177962315800",
"name": "feedType"
},
{
"id": "6:8550232341754154098",
"indexId": "5:680938987943440350",
"name": "feedElementToOneId"
}
],
"relations": []
},
{
"id": "4:7537217652864317597",
"lastPropertyId": "3:6112954104554042430",
"name": "FeedElement",
"properties": [
{
"id": "1:4926947771749822767",
"name": "id"
},
{
"id": "2:8131453946945993591",
"name": "nextUrl"
},
{
"id": "3:6112954104554042430",
"name": "feedElementType"
}
],
"relations": []
},
{
"id": "5:2348793681892920669",
"lastPropertyId": "8:7488175383318173729",
"name": "Image",
"properties": [
{
"id": "1:638964174063060815",
"name": "actualId"
},
{
"id": "2:4967935003726444020",
"name": "color"
},
{
"id": "3:1353497332618194831",
"name": "id"
},
{
"id": "4:2887915135519113362",
"name": "url"
},
{
"id": "5:8827023004110736151",
"name": "url1080"
},
{
"id": "6:1795038216616196366",
"name": "url160"
},
{
"id": "7:5076768945024929823",
"name": "url360"
},
{
"id": "8:7488175383318173729",
"indexId": "6:4968485658423571275",
"name": "baseExperienceId"
}
],
"relations": []
},
{
"id": "6:2806463549017646468",
"lastPropertyId": "7:1664725566577873631",
"name": "Location",
"properties": [
{
"id": "1:151476474888340297",
"name": "id"
},
{
"id": "2:6138069029925290631",
"name": "city"
},
{
"id": "3:8096792582877437443",
"name": "formattedAddress"
},
{
"id": "4:8477355478574191642",
"name": "mapImgUrl"
},
{
"id": "5:5250680748074469313",
"name": "redirectUrl"
},
{
"id": "6:5264044175718414745",
"name": "lat"
},
{
"id": "7:1664725566577873631",
"name": "lng"
}
],
"relations": []
},
{
"id": "7:1386266048121100599",
"lastPropertyId": "19:3626459003273476368",
"name": "User",
"properties": [
{
"id": "1:7194535953200583315",
"name": "id"
},
{
"id": "2:5880155672016170214",
"name": "age"
},
{
"id": "3:7058496909689094561",
"name": "bio"
},
{
"id": "4:7069552521054985458",
"name": "dob"
},
{
"id": "5:2017478464009051869",
"name": "education"
},
{
"id": "6:7411668424835907052",
"name": "email"
},
{
"id": "7:3598420919065748818",
"name": "fullName"
},
{
"id": "8:55256390599336845",
"name": "gender"
},
{
"id": "10:4287083418016851024",
"name": "numberVerified"
},
{
"id": "11:7486368292287445046",
"name": "phoneNumber"
},
{
"id": "12:332314590071314536",
"name": "shareableUrl"
},
{
"id": "13:3581159011829058253",
"name": "showTutorial"
},
{
"id": "14:45244862441869123",
"name": "username"
},
{
"id": "15:80719230754500568",
"name": "verified"
},
{
"id": "16:8347557177943880481",
"name": "work"
},
{
"id": "17:8060185784410064574",
"indexId": "7:3086777593508744479",
"name": "locationRelationId"
},
{
"id": "18:7093446540087310685",
"indexId": "8:4392926741093129871",
"name": "profilePictureRelationId"
},
{
"id": "19:3626459003273476368",
"name": "host"
}
],
"relations": []
},
{
"id": "8:8172185837942255744",
"lastPropertyId": "4:2905712751785391104",
"name": "Video",
"properties": [
{
"id": "1:4230636119749821279",
"name": "id"
},
{
"id": "2:7059360054054181511",
"name": "nightMode"
},
{
"id": "3:7865268851517989166",
"name": "thumbnailUrl"
},
{
"id": "4:2905712751785391104",
"name": "url"
}
],
"relations": []
}
],
"lastEntityId": "8:8172185837942255744",
"lastIndexId": "8:4392926741093129871",
"lastRelationId": "0:0",
"lastSequenceId": "0:0",
"modelVersion": 4,
"modelVersionParserMinimum": 4,
"retiredEntityUids": [],
"retiredIndexUids": [],
"retiredPropertyUids": [
5678282376830830494
],
"retiredRelationUids": [],
"version": 1
}
Now after adding two new properties to my entity:
#Entity
public class BookingItem {
//region Variables
private long id;
#Id(assignable = true)
private long priority;
private String date;
private String formattedAddress;
private String orderId;
private String type;
private String title;
private int seatCount;
private String pricePerPerson;
private String totalTax; // 1st new propery
private String totalAmount; // 2nd new property
private String time;
private String day;
private String redirectUrl;
private String status;
private long experienceId;
private String shareableUrl;
private ToOne<Image> image;
private ToOne<FeedElement> feedElementToOne;
//endregion
}
and my default.json file:
{
"_note1": "KEEP THIS FILE! Check it into a version control system (VCS) like git.",
"_note2": "ObjectBox manages crucial IDs for your object model. See docs for details.",
"_note3": "If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.",
"entities": [
{
"id": "1:797065206246794980",
"lastPropertyId": "6:5238604438383493820",
"name": "Feed",
"properties": [
{
"id": "1:4778143127430396941",
"name": "id"
},
{
"id": "2:2758756424257447876",
"name": "type"
},
{
"id": "3:8593664445454711775",
"name": "title"
},
{
"id": "4:3260484052954017714",
"name": "seeAll"
},
{
"id": "5:5439051893044673734",
"name": "feedType"
},
{
"id": "6:5238604438383493820",
"indexId": "1:9094671316112178979",
"name": "feedElementToOneId"
}
],
"relations": []
},
{
"id": "2:6365001579184770311",
"lastPropertyId": "8:4101477603790778141",
"name": "BaseExperience",
"properties": [
{
"id": "1:22769140630409817",
"name": "id"
},
{
"id": "2:9018492547283474382",
"name": "actualId"
},
{
"id": "3:7038610176041110296",
"name": "avgRating"
},
{
"id": "4:6685630808795149304",
"name": "customerReviewsCount"
},
{
"id": "5:700371560430014226",
"name": "pricePerPerson"
},
{
"id": "6:5016151397612468696",
"name": "title"
},
{
"id": "7:1936717642548225179",
"indexId": "2:1430584179264421000",
"name": "videoId"
},
{
"id": "8:4101477603790778141",
"indexId": "3:2605016395080192788",
"name": "feedToOneId"
}
],
"relations": []
},
{
"id": "3:6907123400855664498",
"lastPropertyId": "7:2458659011456972963",
"name": "Location",
"properties": [
{
"id": "1:7686305118064424277",
"name": "id"
},
{
"id": "2:2382662573706119095",
"name": "city"
},
{
"id": "3:6622007474920998885",
"name": "formattedAddress"
},
{
"id": "4:4372387463973357662",
"name": "mapImgUrl"
},
{
"id": "5:4242635850865049170",
"name": "redirectUrl"
},
{
"id": "6:6362649356171979743",
"name": "lat"
},
{
"id": "7:2458659011456972963",
"name": "lng"
}
],
"relations": []
},
{
"id": "4:1653889744595737127",
"lastPropertyId": "4:1222058476100793989",
"name": "Video",
"properties": [
{
"id": "1:8884142329290866772",
"name": "id"
},
{
"id": "2:9063641434858436120",
"name": "nightMode"
},
{
"id": "3:6750530027777030938",
"name": "thumbnailUrl"
},
{
"id": "4:1222058476100793989",
"name": "url"
}
],
"relations": []
},
{
"id": "5:2328616238996484251",
"lastPropertyId": "18:8914368039716260545",
"name": "User",
"properties": [
{
"id": "1:8699946482619760537",
"name": "id"
},
{
"id": "2:4839102804066560980",
"name": "age"
},
{
"id": "3:4125992685805831147",
"name": "bio"
},
{
"id": "4:1279509102068824378",
"name": "dob"
},
{
"id": "5:2555427309043212840",
"name": "education"
},
{
"id": "6:5872521230199756193",
"name": "email"
},
{
"id": "7:3289121993356321",
"name": "fullName"
},
{
"id": "8:568408267657413444",
"name": "gender"
},
{
"id": "9:5476542265369423309",
"name": "host"
},
{
"id": "10:7787973054527294793",
"name": "numberVerified"
},
{
"id": "11:7196291790521558535",
"name": "phoneNumber"
},
{
"id": "12:1859664059288662356",
"name": "shareableUrl"
},
{
"id": "13:4056506903853763516",
"name": "showTutorial"
},
{
"id": "14:5747800400884843324",
"name": "username"
},
{
"id": "15:3715522420100243828",
"name": "verified"
},
{
"id": "16:3996139181248738872",
"name": "work"
},
{
"id": "17:3912614163504861034",
"indexId": "4:724013235730952653",
"name": "locationRelationId"
},
{
"id": "18:8914368039716260545",
"indexId": "5:9128231055610190580",
"name": "profilePictureRelationId"
}
],
"relations": []
},
{
"id": "6:162879391314678826",
"lastPropertyId": "19:5998558359424914894",
"name": "BookingItem",
"properties": [
{
"id": "1:7685664473128076565",
"name": "id"
},
{
"id": "2:4691963051617887607",
"name": "priority"
},
{
"id": "3:4751608989851978419",
"name": "date"
},
{
"id": "4:4298668252649681543",
"name": "formattedAddress"
},
{
"id": "5:3557896982175720249",
"name": "orderId"
},
{
"id": "6:5444396912371992185",
"name": "type"
},
{
"id": "7:6350566628717896888",
"name": "title"
},
{
"id": "8:5815948248926709539",
"name": "seatCount"
},
{
"id": "9:1347517584208111506",
"name": "pricePerPerson"
},
{
"id": "10:161182016726729049",
"name": "totalTax"
},
{
"id": "11:2603677420345643342",
"name": "totalAmount"
},
{
"id": "12:6964519603978301018",
"name": "time"
},
{
"id": "13:6563743671015329186",
"name": "day"
},
{
"id": "14:5252213579952934956",
"name": "redirectUrl"
},
{
"id": "15:213202584538548112",
"name": "status"
},
{
"id": "16:2664627056996276806",
"name": "experienceId"
},
{
"id": "17:5051545379861430992",
"name": "shareableUrl"
},
{
"id": "18:4513563003576451503",
"indexId": "6:4794120774209056940",
"name": "imageId"
},
{
"id": "19:5998558359424914894",
"indexId": "7:2963448740658161805",
"name": "feedElementToOneId"
}
],
"relations": []
},
{
"id": "7:6072605387056962258",
"lastPropertyId": "8:620926858576597520",
"name": "Image",
"properties": [
{
"id": "1:4722495423798219248",
"name": "actualId"
},
{
"id": "2:5785809790036589091",
"name": "color"
},
{
"id": "3:898405045397421733",
"name": "id"
},
{
"id": "4:5442888368829266995",
"name": "url"
},
{
"id": "5:3501485434468197765",
"name": "url1080"
},
{
"id": "6:1316954607651171513",
"name": "url160"
},
{
"id": "7:2942445530687114413",
"name": "url360"
},
{
"id": "8:620926858576597520",
"indexId": "8:7864085141767381960",
"name": "baseExperienceId"
}
],
"relations": []
},
{
"id": "8:7509306813647547019",
"lastPropertyId": "3:6958687385472305063",
"name": "FeedElement",
"properties": [
{
"id": "1:3560464698535580090",
"name": "id"
},
{
"id": "2:7436822921002379968",
"name": "nextUrl"
},
{
"id": "3:6958687385472305063",
"name": "feedElementType"
}
],
"relations": []
}
],
"lastEntityId": "8:7509306813647547019",
"lastIndexId": "8:7864085141767381960",
"lastRelationId": "0:0",
"lastSequenceId": "0:0",
"modelVersion": 4,
"modelVersionParserMinimum": 4,
"retiredEntityUids": [],
"retiredIndexUids": [],
"retiredPropertyUids": [],
"retiredRelationUids": [],
"version": 1
}
In case you deleted the app/objectbox-models/default.json and uninstalled the app from your android device but the issue still prevails check your manifest file for android:allowBackup="true" and change it to false. Then repeat the steps again.
This cost me an hour of my life, hope it helps.
Source: The Nuke Option
Here's the solution as stated in the GitHub issue:
The IDs of the two versions in your project are totally off: https://www.diffchecker.com/PF3UlSM7
Please revert to the old "default.json" file and rebuild. There should only be little differences in this file on updates.
Yep. You probably changed your object structure after it created once.
The easiest option to solve it:
Like you said, If it possible you need to remove the default.json file (that build automatically while you build your project). and in the next build it will create again.
I recommend you to read about Resolving Meta Model Conflicts in objectbox documentation.
My issue is resolved and the issue actually is that I deleted my old default.json file by mistake which i didn't have to, which eventually led to regenerate the ids of all the entities and caused me a mismatching UID exception. Thanks to Markus Junginger.

How to obtain/parse JSONObject data with GSON

I am trying to use retrofit with android, which is kind of forcing me to use gson.
I am trying to get the data from the payload["response"]["docs"][0]["web_url"] in my code.
Issue : the key getResponse(), from below model class, always gives me {}. Whats the right way to handle this in android? Also note, the getCopyright() & getStatus() are working fine.
I am also providing the sample payload.
I have the model class like this :
public class ArticleSearchResponseModel {
#SerializedName("status") private String status;
#SerializedName("copyright") private String copyright;
#SerializedName("response") private JSONObject response;
public String getStatus() {
return status;
}
public String getCopyright() {
return copyright;
}
public JSONObject getResponse() {
return response;
}
public void setStatus(String status) {
this.status = status;
}
public void setCopyright(String copyright) {
this.copyright = copyright;
}
public void setResponse(JSONObject response) {
this.response = response;
}
}
My payload :
{
"response": {
"meta": {
"hits": 15987906,
"time": 108,
"offset": 0
},
"docs": [
{
"web_url": "http://www.nytimes.com/2016/11/13/insider/gender-issues-in-sharp-focus-at-the-times.html",
"snippet": "Susan Chira, senior correspondent for gender issues, and Susan Dominus, a Times Magazine writer, talk about men, women and coverage of their changing roles.",
"lead_paragraph": "Susan Chira, senior correspondent for gender issues, and Susan Dominus, a Times Magazine writer, talk about men, women and coverage of their changing roles.",
"abstract": null,
"print_page": null,
"blog": [],
"source": "The New York Times",
"multimedia": [
{
"width": 190,
"url": "images/2016/10/14/insider/14-Insider-SUSANIMAGE/14-Insider-SUSANIMAGE-thumbWide.jpg",
"height": 126,
"subtype": "wide",
"legacy": {
"wide": "images/2016/10/14/insider/14-Insider-SUSANIMAGE/14-Insider-SUSANIMAGE-thumbWide.jpg",
"wideheight": "126",
"widewidth": "190"
},
"type": "image"
},
{
"width": 600,
"url": "images/2016/10/14/insider/14-Insider-SUSANIMAGE/14-Insider-SUSANIMAGE-articleLarge.jpg",
"height": 400,
"subtype": "xlarge",
"legacy": {
"xlargewidth": "600",
"xlarge": "images/2016/10/14/insider/14-Insider-SUSANIMAGE/14-Insider-SUSANIMAGE-articleLarge.jpg",
"xlargeheight": "400"
},
"type": "image"
},
{
"width": 75,
"url": "images/2016/10/14/insider/14-Insider-SUSANIMAGE/14-Insider-SUSANIMAGE-thumbStandard.jpg",
"height": 75,
"subtype": "thumbnail",
"legacy": {
"thumbnailheight": "75",
"thumbnail": "images/2016/10/14/insider/14-Insider-SUSANIMAGE/14-Insider-SUSANIMAGE-thumbStandard.jpg",
"thumbnailwidth": "75"
},
"type": "image"
}
],
"headline": {
"main": "Gender Issues in Sharp Focus at The Times",
"content_kicker": "Insider Podcasts",
"kicker": "Insider Podcast"
},
"keywords": [
{
"rank": "1",
"is_major": "N",
"name": "subject",
"value": "Presidential Election of 2016"
},
{
"rank": "2",
"is_major": "N",
"name": "subject",
"value": "Women and Girls"
},
{
"rank": "3",
"is_major": "N",
"name": "subject",
"value": "Gender"
},
{
"rank": "4",
"is_major": "N",
"name": "subject",
"value": "Men and Boys"
},
{
"rank": "5",
"is_major": "N",
"name": "persons",
"value": "Trump, Donald J"
}
],
"pub_date": "2016-11-13T00:00:00Z",
"document_type": "article",
"news_desk": "Insider",
"section_name": "Times Insider",
"subsection_name": null,
"byline": {
"person": [
{
"organization": "",
"role": "reported",
"firstname": "Susan",
"rank": 1,
"lastname": "LEHMAN"
}
],
"original": "By SUSAN LEHMAN"
},
"type_of_material": "News",
"_id": "58011d9b253f0a0e44966174",
"word_count": null,
"slideshow_credits": null
},
{
"web_url": "http://www.nytimes.com/2016/10/25/realestate/doors-of-manhattan.html",
"snippet": "Even though they stand between us and the chaos of the city, the borough’s distinctive doors are easy to overlook.",
"lead_paragraph": "Even though they stand between us and the chaos of the city, the borough’s distinctive doors are easy to overlook.",
"abstract": null,
"print_page": null,
"blog": [],
"source": "The New York Times",
"multimedia": [],
"headline": {
"main": "Doors of Manhattan",
"content_kicker": "Voyeur",
"kicker": "Voyeur"
},
"keywords": [
{
"rank": "1",
"is_major": "N",
"name": "subject",
"value": "Real Estate and Housing (Residential)"
},
{
"rank": "2",
"is_major": "N",
"name": "subject",
"value": "Architecture"
},
{
"rank": "3",
"is_major": "N",
"name": "glocations",
"value": "Upper West Side (Manhattan, NY)"
},
{
"rank": "4",
"is_major": "N",
"name": "glocations",
"value": "Upper East Side (Manhattan, NY)"
}
],
"pub_date": "2016-10-25T00:00:00Z",
"document_type": "article",
"news_desk": "RealEstate",
"section_name": "Real Estate",
"subsection_name": null,
"byline": {
"person": [
{
"firstname": "Photographs",
"middlename": "George",
"lastname": "ETHEREDGE",
"rank": 1,
"role": "reported",
"organization": ""
}
],
"original": "Photographs by GEORGE ETHEREDGE for THE NEW YORK TIMES"
},
"type_of_material": "News",
"_id": "57e94175253f0a6bb40cbffc",
"word_count": null,
"slideshow_credits": null
},
{
"web_url": "http://cooking.nytimes.com/recipes/1018356-celery-toasts",
"snippet": "This was the first recipe that the chef and writer Gabrielle Hamilton brought to The Times as an Eat columnist for the Sunday magazine in 2016, a snack-tray-sandwich version of a celery-and-fennel salad served at her restaurant, Prune, in the East...",
"lead_paragraph": "This was the first recipe that the chef and writer Gabrielle Hamilton brought to The Times as an Eat columnist for the Sunday magazine in 2016, a snack-tray-sandwich version of a celery-and-fennel salad served at her restaurant, Prune, in the East Village. It calls for thick, white toasted Pullman bread spread wall to wall with unsalted butter, with slices of blue cheese neatly laid on top, below a mound of shaved celery and thinly sliced scallions dressed in garlic, olive oil, lemon juice and salt, and the whole shebang dusted in ground black pepper before being cut in halves or quarters. \"The ingredients come from the grocery store,\" she wrote in her column. \"These toasts are not expensive or intimidating, but they are outstanding.\"",
"abstract": null,
"print_page": null,
"blog": [],
"source": "du_recipe",
"multimedia": [
{
"credit": "Davide Luciano for The New York Times. Food stylist: Michelle Gatton. Prop stylist: Alex Brannian.",
"url": "images/2016/10/23/magazine/23eat/23eat-thumbStandard-v2.jpg",
"rank": "1",
"height": 75,
"subtype": "thumbnail",
"legacy": [],
"caption": "Celery Toasts",
"type": "image",
"width": 75
},
{
"credit": "Davide Luciano for The New York Times. Food stylist: Michelle Gatton. Prop stylist: Alex Brannian.",
"url": "images/2016/10/23/magazine/23eat/23mag-23eat-t_CA1-articleLarge.jpg",
"rank": "1",
"height": 400,
"subtype": "large",
"legacy": [],
"caption": "Celery Toasts",
"type": "image",
"width": 600
}
],
"headline": {
"main": "A Snack Tray to Gather the Family Around",
"name": "Celery Toasts"
},
"keywords": [],
"pub_date": "2016-10-23T00:00:00Z",
"document_type": "recipe",
"news_desk": null,
"section_name": null,
"subsection_name": null,
"byline": {
"person": [
{
"organization": "",
"role": "reported",
"firstname": "Gabrielle",
"rank": 1,
"lastname": "Hamilton"
}
],
"original": "Gabrielle Hamilton"
},
"type_of_material": "Recipe",
"_id": "580696f1253f0a7d028b0864",
"word_count": "101",
"slideshow_credits": null
},
{
"web_url": "http://www.nytimes.com/2016/10/23/books/review/the-story-behind-this-weeks-best-sellers.html",
"snippet": "Ruth Bader Ginsburg, whose anthology “My Own Words” is No. 12 in hardcover nonfiction, has something in common with Notorious B.I.G.",
"lead_paragraph": "Ruth Bader Ginsburg, whose anthology “My Own Words” is No. 12 in hardcover nonfiction, has something in common with Notorious B.I.G.",
"abstract": null,
"print_page": "30",
"blog": [],
"source": "The New York Times",
"multimedia": [
{
"width": 190,
"url": "images/2016/10/23/books/review/23inside-list/23inside-list-thumbWide.jpg",
"height": 126,
"subtype": "wide",
"legacy": {
"wide": "images/2016/10/23/books/review/23inside-list/23inside-list-thumbWide.jpg",
"wideheight": "126",
"widewidth": "190"
},
"type": "image"
},
{
"width": 75,
"url": "images/2016/10/23/books/review/23inside-list/23inside-list-thumbStandard.jpg",
"height": 75,
"subtype": "thumbnail",
"legacy": {
"thumbnailheight": "75",
"thumbnail": "images/2016/10/23/books/review/23inside-list/23inside-list-thumbStandard.jpg",
"thumbnailwidth": "75"
},
"type": "image"
}
],
"headline": {
"main": "The Story Behind This Week’s Best Sellers"
},
"keywords": [
{
"rank": "1",
"is_major": "N",
"name": "subject",
"value": "Books and Literature"
},
{
"rank": "2",
"is_major": "N",
"name": "persons",
"value": "Ginsburg, Ruth Bader"
}
],
"pub_date": "2016-10-23T00:00:00Z",
"document_type": "article",
"news_desk": "BookReview",
"section_name": "Books",
"subsection_name": "Book Review",
"byline": {
"person": [
{
"organization": "",
"role": "reported",
"firstname": "Gregory",
"rank": 1,
"lastname": "COWLES"
}
],
"original": "By GREGORY COWLES"
},
"type_of_material": "News",
"_id": "5800f337253f0a7985625011",
"word_count": null,
"slideshow_credits": null
},
{
"web_url": "http://www.nytimes.com/2016/10/23/books/review/ngugi-wa-thiongo-birth-of-a-dream-weaver.html",
"snippet": "A Kenyan considers his early years as a student and writer.",
"lead_paragraph": "A Kenyan considers his early years as a student and writer.",
"abstract": null,
"print_page": "25",
"blog": [],
"source": "The New York Times",
"multimedia": [
{
"width": 190,
"url": "images/2016/10/23/books/review/23Wrong/23Wrong-thumbWide.jpg",
"height": 126,
"subtype": "wide",
"legacy": {
"wide": "images/2016/10/23/books/review/23Wrong/23Wrong-thumbWide.jpg",
"wideheight": "126",
"widewidth": "190"
},
"type": "image"
},
{
"width": 600,
"url": "images/2016/10/23/books/review/23Wrong/23Wrong-articleLarge.jpg",
"height": 400,
"subtype": "xlarge",
"legacy": {
"xlargewidth": "600",
"xlarge": "images/2016/10/23/books/review/23Wrong/23Wrong-articleLarge.jpg",
"xlargeheight": "400"
},
"type": "image"
},
{
"width": 75,
"url": "images/2016/10/23/books/review/23Wrong/23Wrong-thumbStandard.jpg",
"height": 75,
"subtype": "thumbnail",
"legacy": {
"thumbnailheight": "75",
"thumbnail": "images/2016/10/23/books/review/23Wrong/23Wrong-thumbStandard.jpg",
"thumbnailwidth": "75"
},
"type": "image"
}
],
"headline": {
"main": "Ngugi wa Thiong’o on Starting Out as a Writer",
"content_kicker": "Nonfiction",
"kicker": "Nonfiction",
"print_headline": "A Long Look Back"
},
"keywords": [
{
"rank": "2",
"is_major": "N",
"name": "persons",
"value": "Thiong'o, Ngugi wa"
},
{
"rank": "3",
"is_major": "N",
"name": "subject",
"value": "Books and Literature"
},
{
"rank": "4",
"is_major": "N",
"name": "subject",
"value": "Writing and Writers"
}
],
"pub_date": "2016-10-23T00:00:00Z",
"document_type": "article",
"news_desk": "BookReview",
"section_name": "Books",
"subsection_name": "Book Review",
"byline": {
"person": [
{
"organization": "",
"role": "reported",
"firstname": "Michela",
"rank": 1,
"lastname": "WRONG"
}
],
"original": "By MICHELA WRONG"
},
"type_of_material": "Review",
"_id": "57ff4d1d253f0a6b9720abd2",
"word_count": null,
"slideshow_credits": null
},
{
"web_url": "http://cooking.nytimes.com/recipes/1018347-lemon-drizzle-cake",
"snippet": "This light and moist lemon poundcake has a crunchy sugar glaze that crystallizes on top, giving a contrasting texture to the soft crumb underneath. It’s an easy-to-make, crowd-pleasing cake that’s excellent on its own but takes well to...",
"lead_paragraph": "This light and moist lemon poundcake has a crunchy sugar glaze that crystallizes on top, giving a contrasting texture to the soft crumb underneath. It’s an easy-to-make, crowd-pleasing cake that’s excellent on its own but takes well to embellishments. A scoop of ice cream or sorbet, fruit compote and-or lemon curd are all wonderful alongside.",
"abstract": null,
"print_page": null,
"blog": [],
"source": "du_recipe",
"multimedia": [
{
"credit": "Andrew Scrivani for The New York Times",
"url": "images/2016/10/19/dining/19BAKEOFF2/19BAKEOFF2-thumbStandard.jpg",
"rank": "1",
"height": 75,
"subtype": "thumbnail",
"legacy": [],
"type": "image",
"width": 75
},
{
"credit": "Andrew Scrivani for The New York Times",
"url": "images/2016/10/19/dining/19BAKEOFF2/19BAKEOFF2-articleLarge.jpg",
"rank": "1",
"height": 400,
"subtype": "large",
"legacy": [],
"type": "image",
"width": 600
}
],
"headline": {
"main": "‘The Great British Bake Off’ Changes the Way the British Bake",
"name": "Lemon Drizzle Cake"
},
"keywords": [],
"pub_date": "2016-10-19T00:00:00Z",
"document_type": "recipe",
"news_desk": null,
"section_name": null,
"subsection_name": null,
"byline": {
"person": [
{
"organization": "",
"role": "reported",
"firstname": "Melissa",
"rank": 1,
"lastname": "Clark"
}
],
"original": "Melissa Clark"
},
"type_of_material": "Recipe",
"_id": "58066d7c253f0a7d028b07d0",
"word_count": "250",
"slideshow_credits": null
}
]
},
"status": "OK",
"copyright": "Copyright (c) 2013 The New York Times Company. All Rights Reserved."
}
Before start, I'm not familiar with retrofit.
If you want serialize/unserialize json to pojo, you better make pojo object.
class Response {
Meta meta;
List<Docs> docs;
}
class Docs {
String webUrl;
Mutimedia multimedia;
...
}
The issue the key getResponse(), from below model class, always gives me {} happens because gson cannot determine proper object to convert json to plain old java object.
In order to make your Response model class use http://www.jsonschema2pojo.org/.
Making POJO simple
you no need to make exact structure in model
you can go ahead with your code just need small change
Use
#SerializedName("response") private JsonObject response;
instead of
#SerializedName("response") private JSONObject response;
and in the import
import com.google.gson.JsonObject;

missing fields in profile from LinkedIn Android SDK

I'm using the LinkedIn Android SDK downloaded from here (version 1.1.4) and have set up authentication already like this:
liSessionManager.init(activity,
Scope.build(Scope.R_BASICPROFILE, Scope.R_EMAILADDRESS), authListener);
and everything works fine, but when I want to get the profile data, returned json is missing fields like summary in job positions and general summary for the given profile.
The request is made like this:
apiHelper.getRequest(activity, GET_LINKED_IN_PROFILE_URL, apiListener);
where GET_LINKED_IN_PROFILE_URL is https://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address,formatted-name,headline,location,industry,current-share,num-connections,num-connections-capped,summary,specialties,positions,phone-numbers,public-profile-url,picture-url,picture-urls::(original))?format=json.
The response is as follows:
{
"currentShare": {
"author": {
"firstName": "Name",
"id": "***",
"lastName": "Surname"
},
"comment": "I've made my LinkedIn profile visual! Check it out and get yours!",
"content": {
"description": "some descr",
"eyebrowUrl": "http://url.com/me/7827748?m_in&user_id=***",
"resolvedUrl": "http://url.com/me/7827748?m_in&user_id=***",
"shortenedUrl": "http://linkedin.in/url",
"submittedImageUrl": "https://www.url.com/logo-share.png",
"submittedUrl": "https://www.url.com/me/***?m_in&user_id=***",
"thumbnailUrl": "https://media.licdn.com/media-proxy/ext?w=80&h=100&f=&hash=usON2E%2F4FqEGtIT5dsadsaaD&ora=1%2CaFBCTXdkRmpGL2lvQUFBPQ%2CxAVta5g-0R65wFUbzx0776dsaulz-50hKCpDZEXX8HmW3uZHfgasdapuGJ-n08ARIZ3Bex1svPLf5AmX_Us3r",
"title": "title"
},
"id": "s1291360434",
"source": {
"application": {"name": "app"},
"serviceProvider": {"name": "LINKEDIN"}
},
"timestamp": 1346884888000,
"visibility": {"code": "anyone"}
},
"emailAddress": "***#gmail.com",
"firstName": "Name",
"formattedName": "Name Surname",
"headline": "Job position",
"id": "***",
"industry": "Computer Software",
"lastName": "Surname",
"location": {
"country": {"code": "pl"},
"name": "Wroclaw, Lower Silesian District, Poland"
},
"numConnections": 229,
"numConnectionsCapped": false,
"pictureUrl": "https://media.licdn.com/mpr/mprx/photourl",
"pictureUrls": {
"_total": 1,
"values": ["https://media.licdn.com/mpr/mprx/photourl"]
},
"positions": {
"_total": 1,
"values": [{
"company": {
"id": 2795963,
"industry": "Information Technology & Services",
"name": "Company 1",
"size": "11-50",
"type": "Privately Held"
},
"id": ***,
"isCurrent": true,
"location": {
"country": {
"code": "pl",
"name": "Poland"
},
"name": "Wroclaw, Lower Silesian District, Poland"
},
"startDate": {
"month": 1,
"year": 2016
},
"title": "Job position"
}]
},
"publicProfileUrl": "https://www.linkedin.com/in/username/41219"
}
When I use the same url in the API Console at https://apigee.com/console/linkedin, the response looks like this:
{
"currentShare": {
"author": {
"firstName": "Name",
"id": "***",
"lastName": "Surname"
},
"comment": "I've made my LinkedIn profile visual! Check it out and get yours!",
"content": {
"description": "some descr",
"eyebrowUrl": "http://url.com/me/7827748?m_in&user_id=***",
"resolvedUrl": "http://url.com/me/7827748?m_in&user_id=***",
"shortenedUrl": "http://linkedin.com/shortened",
"submittedImageUrl": "https://www.url.com/logo-share.png",
"submittedUrl": "https://www.url.com/me/***?m_in&user_id=***",
"thumbnailUrl": "https://media.licdn.com/media-proxy/ext?w=80&h=100&f=&hash=usON2E%2F4FqEGtIT5dsadsaaD&ora=1%2CaFBCTXdkRmpGL2lvQUFBPQ%2CxAVta5g-0R65wFUbzx0776dsaulz-50hKCpDZEXX8HmW3uZHfgasdapuGJ-n08ARIZ3Bex1svPLf5AmX_Us3r",
"title": "title"
},
"id": "s1291360434",
"source": {
"application": {
"name": "app"
},
"serviceProvider": {
"name": "LINKEDIN"
}
},
"timestamp": 1346884888000,
"visibility": {
"code": "anyone"
}
},
"emailAddress": "***#gmail.com",
"firstName": "Name",
"formattedName": "Name Surname",
"headline": "Job position",
"id": "***",
"industry": "Computer Software",
"lastName": "Surname",
"location": {
"country": {
"code": "pl"
},
"name": "Wroclaw, Lower Silesian District, Poland"
},
"numConnections": 229,
"numConnectionsCapped": false,
"pictureUrl": "https://media.licdn.com/mpr/mprx/photourl",
"pictureUrls": {
"_total": 1,
"values": [
"https://media.licdn.com/mpr/mprx/photourl"
]
},
"positions": {
"_total": 1,
"values": [
{
"company": {
"id": 2795963,
"industry": "Information Technology & Services",
"name": "Company 1",
"size": "11-50",
"type": "Privately Held"
},
"id": 22222,
"isCurrent": true,
"location": {
"country": {
"code": "pl",
"name": "Poland"
},
"name": "Wroclaw, Lower Silesian District, Poland"
},
"startDate": {
"month": 1,
"year": 2016
},
"title": "Job position"
},
{
"company": {
"id": 611639,
"industry": "Internet",
"name": "Company 2",
"size": "51-200",
"type": "Privately Held"
},
"endDate": {
"month": 2,
"year": 2016
},
"id": 1111,
"isCurrent": false,
"location": {
"country": {
"code": "pl",
"name": "Poland"
},
"name": "Wroclaw, Lower Silesian District, Poland"
},
"startDate": {
"month": 4,
"year": 2015
},
"summary": "Summary of job",
"title": "Senior Android Developer"
},
{
"company": {
"id": 1111,
"industry": "Internet",
"name": "Company 2",
"size": "51-200",
"type": "Privately Held"
},
"endDate": {
"month": 3,
"year": 2015
},
"id": 111111,
"isCurrent": false,
"location": {
"country": {
"code": "pl",
"name": "Poland"
},
"name": "Wroclaw, Lower Silesian District, Poland"
},
"startDate": {
"month": 4,
"year": 2014
},
"summary": "short summary",
"title": "Android/iOS Developer"
},
{
"company": {
"id": 11111,
"industry": "Internet",
"name": "Company 2",
"size": "51-200",
"type": "Privately Held"
},
"endDate": {
"month": 3,
"year": 2014
},
"id": 1111111,
"isCurrent": false,
"location": {
"country": {
"code": "pl",
"name": "Poland"
},
"name": "Wroclaw, Lower Silesian District, Poland"
},
"startDate": {
"month": 2,
"year": 2013
},
"summary": "android applications developer.\ncross-platform mobile application testing (iOS, Windows 8)",
"title": "Junior Android Developer"
},
{
"company": {
"id": 3333,
"industry": "Information Technology & Services",
"name": "Company 3",
"size": "201-500",
"type": "Privately Held"
},
"endDate": {
"month": 11,
"year": 2011
},
"id": 3333333,
"isCurrent": false,
"location": {
"country": {
"code": "pl",
"name": "Poland"
},
"name": "Warsaw, Masovian District, Poland"
},
"startDate": {
"month": 7,
"year": 2011
},
"summary": "Intern ",
"title": "Internship"
}
]
},
"publicProfileUrl": "https://www.linkedin.com/in/username/41219"
}
Which shows that the Android SDK's response is missing some job positions and a summary for a profile.
It turned out LinkedIn is not returning fields that have no value. If you don't setup a summary in your profile, then there won't be a field named summary in the response. (Don't expect anything like "summary" : null)
Additionally only first position is returned for a given profile while using r_basicprofile scope. It's confusing since this one profile is returned in the positions array.
based on https://developer.linkedin.com/docs/fields/basic-profile :
Positions - An object representing the member's current position.
See Position Fields for a description of the fields available within this object.
The reason why the API Console's response was having all job positions is because it asked for r_fullprofile scope while authenticating

Contentful Product Catalogue Error

I have download this CONTENTFUL CMS product catalogue demo ->https://github.com/contentful/product-catalogue-android. Im using android studio 1.4.
I have set the public token ID in the const.java accordingly but it still get error. At first i think maybe i have set a wrong setting at content_type field setting. But i still cannot find my solution. My error look like below and ive attached images for you to see,
10-23 18:56:18.820 2094-2147/catalogue.contentful E/SQLiteLog: (1) no such table: entry_nulundg0rwhzuvm0suntyxvdzufjrq
(1) no such table: entry_ne90ogm2rdjxuxfnb2fvs2dzbtgysw
This is my JSON statement from my CONTENTFUL "Product": content_type
{
"name": "Product",
"description": "",
"displayField": "productName",
"fields": [
{
"name": "productName",
"id": "productName",
"type": "Symbol",
"localized": false,
"validations": []
},
{
"name": "productDescription",
"id": "productDescription",
"type": "Symbol",
"localized": false,
"validations": []
},
{
"name": "sizetypecolor",
"id": "sizetypecolor",
"type": "Symbol"
},
{
"name": "images",
"id": "images",
"type": "Array",
"items": {
"type": "Link",
"linkType": "Asset",
"validations": []
},
"validations": []
},
{
"name": "categories",
"id": "categories",
"type": "Link",
"linkType": "Entry",
"validations": [
{
"linkContentType": [
"5In484EhYQS4ICSauCeAcE"
]
}
]
},
{
"name": "tags",
"id": "tags",
"type": "Array",
"items": {
"type": "Symbol",
"validations": []
},
"validations": []
},
{
"name": "price",
"id": "price",
"type": "Number",
"validations": []
},
{
"name": "brand",
"id": "brand",
"type": "Link",
"linkType": "Entry",
"validations": [
{
"linkContentType": [
"5gTQW9EcAwEYEc42WGgaEu"
]
}
]
},
{
"name": "quantity",
"id": "quantity",
"type": "Integer",
"localized": false,
"validations": []
},
{
"name": "sku",
"id": "sku",
"type": "Symbol",
"localized": false,
"validations": []
},
{
"name": "website",
"id": "website",
"type": "Symbol",
"localized": false,
"validations": []
}
],
"sys": {
"id": "4Ot8c6D2qQqgoaUKgYm82K",
"type": "ContentType",
"createdAt": "2015-10-23T13:04:54.705Z",
"createdBy": {
"sys": {
"type": "Link",
"linkType": "User",
"id": "2P70I7YlhYLnC0iOpPYYwN"
}
},
"space": {
"sys": {
"type": "Link",
"linkType": "Space",
"id": "b7di2z8ukacn"
}
},
"firstPublishedAt": "2015-10-23T13:04:59.904Z",
"publishedCounter": 17,
"publishedAt": "2015-10-23T17:33:41.088Z",
"publishedBy": {
"sys": {
"type": "Link",
"linkType": "User",
"id": "2P70I7YlhYLnC0iOpPYYwN"
}
},
"publishedVersion": 41,
"version": 42,
"updatedAt": "2015-10-23T17:33:41.107Z",
"updatedBy": {
"sys": {
"type": "Link",
"linkType": "User",
"id": "2P70I7YlhYLnC0iOpPYYwN"
}
}
}
}
And this is my Android Studio coding
public Product$$ModelHelper() {
fields.add(FieldMeta.builder().setId("productName").setName("name").setSqliteType("STRING").build());
fields.add(FieldMeta.builder().setId("productDescription").setName("description").setSqliteType("STRING").build());
fields.add(FieldMeta.builder().setId("sizetypecolor").setName("sizeTypeColor").setSqliteType("STRING").build());
fields.add(FieldMeta.builder().setId("image").setName("images").setArrayType("com.contentful.vault.Asset").build());
fields.add(FieldMeta.builder().setId("tags").setName("tags").setSqliteType("BLOB").setArrayType("java.lang.String").build());
fields.add(FieldMeta.builder().setId("categories").setName("categories").setArrayType("catalogue.contentful.vault.Category").build());
fields.add(FieldMeta.builder().setId("price").setName("price").setSqliteType("DOUBLE").build());
fields.add(FieldMeta.builder().setId("brand").setName("brand").setLinkType("ENTRY").build());
fields.add(FieldMeta.builder().setId("quantity").setName("quantity").setSqliteType("INT").build());
fields.add(FieldMeta.builder().setId("sku").setName("sku").setSqliteType("STRING").build());
fields.add(FieldMeta.builder().setId("website").setName("website").setSqliteType("STRING").build());
}
#Override
public List<FieldMeta> getFields() {
return fields;
}
#Override
public String getTableName() {
return "entry_ne90ogm2rdjxuxfnb2fvs2dzbtgysw";
}
My Android Studio project error screenshot
I really appreciate if anyone can help me with this problem.Because this app is a demo, i really think my problem is at my setting at CONTENTFUL, but maybe i need second opinion. Please help.
Thank you.
Hello Mario from Contentful here,
As I could see from the code you provided, it seems as if you changed the generated classes. Can you try changing the Product.java using the annotations provided by vault to create a Product matching your data?
This also needs to be done with all the other ContentTypes, you created in the Contentful-WebUI.

Categories

Resources