#Region Service Attributes
#StartAtBoot: true
#StartCommandReturnValue: android.app.Service.START_STICKY
#End Region
Sub Process_Globals
Dim json As JSONParser
Dim mapaNotificacion As Map
End Sub
Sub Service_Create
End Sub
Sub Service_Start (StartingIntent As Intent)
Dim h As HttpJob
h.initialize("json1", Me)
h.Download2("http://www.xxx", Array As String("iNumSer", "0", "iMovDes", "120"))
StartServiceAt("", DateTime.Now + 30 * DateTime. TicksPerSecond, True)
End Sub
Sub Service_Destroy
End Sub
Sub JobDone(job As HttpJob)
If job.Success Then
json.Initialize(job.GetString)
mapaNotificacion=json.NextObject
Dim data As List
data=mapaNotificacion.Get("data")
Dim avs_ndt As Int
avs_ndt = "0"
For i=0 To data.Size-1
mapaNotificacion=data.Get(i)
avs_ndt = (mapaNotificacion.Get("tsp_avs_ntf"))
Next
If avs_ndt = "1" Then
Dim n As Notification
n.Initialize
frm_srv_acp.VariablePedido = (mapaNotificacion.Get("tsp_num_ser"))
n.SetInfo("Servicio", mapaNotificacion.Get("tsp_num_ser"), frm_srv_acp)
n.Icon = "icon"
n.Notify(mapaNotificacion.Get("tsp_num_ser"))
End If
avs_ndt = "0"
Else
Msgbox(job.ErrorMessage, "Error")
End If
End Sub