Sub Process_Globals
Dim http As HttpJob
Dim URL As String = "https://url.com/v1"
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("Main")
http.Initialize("http", Me)
http.Download(URL)
End Sub
Sub httpDone (Job As HttpJob)
ProgressDialogHide
If Job.Success = True Then
Try
'DEFINIR VARIABLES JSON
Dim JSON As JSONParser
JSON.Initialize(Job.GetString)
CargarEstadisticas(JSON.NextObject, 1)
Catch
Actualizar("Error al obtener los datos",2, "Intentar de nuevo","Salir")
End Try
Else
Actualizar("Error al conectar con el servidor",2, "Intentar de nuevo","Salir")
End If
End Sub