Android Question b4a - app crash when using https post submit?

IamTrying

Active Member
Licensed User
Released app was working fine. But now suddenly stop working. Library OkHttpUtils2 version 2.61 used.



code:

B4X:
job1.PostString("https://www.site.com/ajax/post/receive", "username=a&password=1234&play=clip1")

Sub JobDone (Job As HttpJob)
    Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
    If Job.Success = True Then
        Select Job.JobName
            Case "job1", "job2"
                'print the result to the logs
                parser.Initialize(Job.GetString)
                Dim root As Map = parser.NextObject
                Dim result As String = root.Get("result")
                Log(result)
                If result = "ok" Then
                    'Activity.Color = Colors.Green
                    Msgbox("OK - Request sent", "SERVER")
                    Dim jsonLine As String
                    jsonLine = $"{agent:""$ & myAgentID & _
                    $"",username:""$ & myUsername & _ 
                    $"",password=""$ & mypassword & $""}"$
                    Log(jsonLine)
                    'writeLogin(jsonLine)
                   

                Else
                    Msgbox("Failed", "Login")
                    Activity.Color = Colors.red
                    'callApp
                End If
   
        End Select
    Else
        Log("Error: " & Job.ErrorMessage)
        ToastMessageShow("Error: " & Job.ErrorMessage, True)
    End If
    Job.Release
End Sub
 

IamTrying

Active Member
Licensed User
@Erel: Thank you. I will avoid use of Global. Very strange i cant reproduce the error now anymore. It was fixed magically without any modification.
Next time i will share text-version.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…