Android Question Create a JSON from List

tamba sylvester

Member
Licensed User
Longtime User
I have a list that I wish to convert to a JSON.

Kindly assist.

array List:
    Dim checkedItems As List
    checkedItems.Initialize
    For i = 0 To 100
        
        If chk.Checked Then
            checkedItems.Add(i)
        End If
    Next
    Log("Items: " & checkedItems)
    
    'convert  checkedItems to JSON
 

mangojack

Expert
Licensed User
Longtime User

The second half of the tutorial deals with your need...
Generating JSON strings is done in a similar way. We create a Map or a List that holds the values and then using JSONGenerator we convert it to a JSON string:
 
Upvote 0
Top