Android Question Converting list of maps to list of arrays

toby

Well-Known Member
Licensed User
Longtime User
I want to get data, number of records, from a remote mysql database and populate a B4XTable with it. The problem I'm having is B4XTable.SetData() expects a list of arrays while
httpjob returns a list of maps.
B4X:
            Dim parser As JSONParser
            parser.Initialize(j.GetString)
            Dim root As List = parser.NextArray

Is there an easy way to convert a list of maps to a list of arrays?
 

DonManfred

Expert
Licensed User
Longtime User
You need to parse the json the correct way.
Then you know how it is structured. You need to build the list of arrays by yourself. Only you know what you are getting from the webservice,
 
Upvote 0

RB Smissaert

Well-Known Member
Licensed User
Longtime User
I want to get data, number of records, from a remote mysql database and populate a B4XTable with it. The problem I'm having is B4XTable.SetData() expects a list of arrays while
httpjob returns a list of maps.
B4X:
            Dim parser As JSONParser
            parser.Initialize(j.GetString)
            Dim root As List = parser.NextArray

Is there an easy way to convert a list of maps to a list of arrays?

Just loop through the map keys and/or values copy to array and add the arrays to the list.

RBS
 
Upvote 0
Top