friends, I am not able to treat the data below, indicates error in "parser.NextObject" where I am wrong?
B4X:
Sub Process_Globals
End Sub
Sub Globals
Private Button1 As Button
Private Label1 As Label
Private Label2 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub ipinfo
Dim GetAddressJob As HttpJob
GetAddressJob.Initialize("GetAddress", Me)
‘curl -X GET --header 'Accept: application/json'
GetAddressJob.Download("http://www.transparencia.gov.br/api-de-dados/bolsa-familia-sacado-por-nis?nis=16052206471&anoMesReferencia=201805&anoMesCompetencia=201805&pagina=1
")
Wait For (GetAddressJob) JobDone(GetAddressJob As HttpJob)
If GetAddressJob.Success Then
Dim parser As JSONParser
parser.Initialize(GetAddressJob.GetString)
Dim root As Map = parser.NextObject ‘error here
Dim id As String = root.Get("id")
Dim nis As String = root.Get("nis")
Log($"id: ${id}"$)
Log($"nis: ${nis}"$
Label1.Text=id
Label2.Text=nis
End If
GetAddressJob.Release
End Sub
sub Button1_click
ipinfo
end sub