I use a service to schedule a call to a PHP script using InitializePost2.
Everything's fine up to several hours running, I cannot be more precise, then it start receiving back a java.net.UnknownHostException error until I restart the emulator (or stop the service on the phone).
Basically the code is:
Do i have to free something ?
Everything's fine up to several hours running, I cannot be more precise, then it start receiving back a java.net.UnknownHostException error until I restart the emulator (or stop the service on the phone).
Basically the code is:
B4X:
sub SendReq
...
req.InitializePost2(adrstr, " ".GetBytes("UTF8"))
hcPos.Execute(req, 1)
end sub
Sub hcPos_ResponseError (Response As HttpResponse, Reason As String, StatusCode As Int, TaskId As Int)
Dim Message As String
Log("Error UPDPOS: " & Reason & ", StatusCode: " & StatusCode)
If Response <> Null Then
Log(Response.GetString("UTF8"))
Response.Release
End If
end sub
Sub hcPos_ResponseSuccess (Response As HttpResponse, TaskId As Int)
Dim res As String
Dim parser As JSONParser
Dim MsgList As List
res = Response.GetString("UTF8")
Log("Response SMSG " & TaskID & " from server: " & res)
parser.Initialize(res)
MsgList = parser.NextArray
... do something
response.Release
End Sub
Do i have to free something ?