Hi all,
my app is suffering from semi-random crashes caused by HTTPJOBS and i can't understand how to get out from the trouble
The codes that i use is like this one:
The Sub called Pippo_Sub is called multiple times by other portions of code so i followed advices on this forum to use "Dim Pippo" everythime i use the httpjob.
And also i removed (temporary) the instruction Pippo.Release
Everything works almost correctly but in some semi-random situations the app crashes with the error:
With Semi-Random i mean that if i do some quick operations that probably call the Pippo_sub rapidly the app crashes always. If i do the same operation slowly everything works perfectly.
So is there an advice on how to use and reuse the same httpjob quickly without crashing the app?
Thanks in advance!
my app is suffering from semi-random crashes caused by HTTPJOBS and i can't understand how to get out from the trouble
The codes that i use is like this one:
B4X:
Sub Process_Globals
Dim Pippo As HttpJob
End Sub
Sub Pippo_Sub
Dim Pippo As HttpJob
Pippo.Initialize("Pippo",Me)
Pippo.PostString("https://xxxxx/test.php", "val1=" & val1 & "&val2=" & val2 & "&val3=" & val3)
End Sub
Sub JobDone (Job As HttpJob)
If Job.JobName="Pippo" Then
If Job.Success = True Then
Dim result As String
result = Pippo.GetString
........
.......
End if
End If
End Sub
The Sub called Pippo_Sub is called multiple times by other portions of code so i followed advices on this forum to use "Dim Pippo" everythime i use the httpjob.
And also i removed (temporary) the instruction Pippo.Release
Everything works almost correctly but in some semi-random situations the app crashes with the error:
B4X:
java.lang.RuntimeException: java.lang.RuntimeException: java.io.FileNotFoundException: /data/user/0/test.app/cache: open failed: EISDIR (Is a directory)
With Semi-Random i mean that if i do some quick operations that probably call the Pippo_sub rapidly the app crashes always. If i do the same operation slowly everything works perfectly.
So is there an advice on how to use and reuse the same httpjob quickly without crashing the app?
Thanks in advance!