Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 121
Registered: ‎02-08-2013
My Device: 9900
My Carrier: verizon
Accepted Solution

problem parsing json array

I have been trying to parse a json response after following examples and sample code on forum but there is no direct example to parse something like [{"uri":"file:///accounts/1000/shared/camera/IMG_00000012.jpg"}] and I can't figure it out, how can I enter into for loop and print every uri in the response?

 

Thanks for any help.

Highlighted
Developer
Posts: 230
Registered: ‎01-12-2013
My Device: z30
My Carrier: Mobile Vikings

Re: problem parsing json array

[ Edited ]

What I do to parse the json is the following

 

JsonDataAccess jda;

QVariantList list = jda.load(reply).value<QVariantList>();

 Then you have a QVariantList and you can iterate over it. Hopes this was a little bit helpfull.

 

EDIT:

I have to say that the reply is a response of a networkrequest. You'll have to find a way of parsing a file with json to a QVariantList. I'll be guessing that google is your best friend for that. "QString to QVariantList" or "json to QVariantList". Something like that.

______________________________________________________
BB10-OAuth: GitHub