'Service module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim hc_size As HttpClient
Dim req_size As HttpRequest
Public Tamaño As Int
End Sub
Sub Service_Create
hc_size.Initialize("hc_size")
req_size.InitializeGet("http://dl.dropbox.com/*/*****/****.db")
req_size.Timeout = 10000
End Sub
Sub Service_Start (StartingIntent As Intent)
hc_size.Execute(req_size, 1)
End Sub
Sub Service_Destroy
End Sub
Sub hc_size_ResponseSuccess(Response As HttpResponse, TaskId As Int)
Tamaño = Response.ContentLength
Log(Tamaño)
Main.Tamaño_Url = Tamaño
StopService("")
End Sub
Sub hc_size_ResponseError (Response As HttpResponse, Reason As String, StatusCode As Int, TaskId As Int)
Msgbox("Error4: " & Reason, "")
Main.Mensaje = 5
If Msgbox2("Error5: " & LastException, "*****", "SALIR", "", "", Null) = DialogResponse.POSITIVE Then
CancelScheduledService(DeviceWakupService)
ExitApplication
End If
End Sub