Android Question Samsung xCover3 crash

imbault

Well-Known Member
Licensed User
Longtime User
Hi,

I Have an app which runs ok on Samsung Galaxy 5

But on xCover3, when I try to use a web service, it randomly crashes (I use okHttp)

Any (good) idea?

Thanks

B4X:
Sub GetDatafromWS
    Dim job1 As HttpJob
    Dim endPoint As String
    Dim requestSoapXML As String
    Dim cDate, NameToCall As String
    DateTime.DateFormat="yyyy-MM-dd"
    cDate = DateTime.date(DateTime.now)
    ProgressDialogShow("Réception des données du serveur...")
    NameToCall = WS_name
    Dim WS_to_call As String
    WS_to_call = WS_Getrdv_User
  
    endPoint = WS_Url
    requestSoapXML = _
        "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>" & _
         "<soap:Body>" & _
           "<" & WS_to_call & " xmlns='http://patrick.imbault.org/'>" & _
             "<sId>" & NameToCall & "</sId>" & _
             "<sPwd>" & WS_password & "</sPwd>" & _
           "</" & WS_to_call & ">" & _
         "</soap:Body>" & _
        "</soap:Envelope>"

    Log(requestSoapXML )


    job1.Initialize("job1","Main")
    job1.PostString ( endPoint, requestSoapXML)
    job1.GetRequest.SetContentType("")
    job1.GetRequest.SetHeader("SOAPAction", "http://patrick.imbault.org/"  & WS_to_call)
    job1.GetRequest.SetHeader("Content-Type", "text/xml; charset=utf-8")
    job1.GetRequest.Timeout = 30000
    Log("run ws")
    End Sub  
  
  
Sub JobDone (Job As HttpJob)
    Log("jobdone")
    Dim resultSoapXML As String
    Dim sRet As String
    Dim i,i2 As Int
  
  
    Sub JobDone (Job As HttpJob)
    Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
    If Job.Success = True Then
        resultSoapXML = Job.GetString
        i = resultSoapXML.IndexOf(">[")
        Log(i)
        If i = -1 Then
            Msgbox("Pas de donnnées.", "Error")
            Return
        End If
        Try
        i2 = resultSoapXML.IndexOf2("]</retrdv_", i + 3)   
        sRet = resultSoapXML.substring2(i + 1, i2+1)
        DB_update(sRet)
        Catch
        Log("pb in getjos")
        End Try
    Else
        Log("Error: " & Job.ErrorMessage)
        ToastMessageShow("Error: " & Job.ErrorMessage, True)
    End If
    ProgressDialogHide
    Log("Job.Release")
    Job.Release
End Sub

Gaining focus: Window{2b106d46 u0 pim_gss_ics.com/pim_gss_ics.com.main}
run ws
getFocusedUser
getFocusedUser: current uesr id is 0
Attempted to finish an input event but the input event receiver has already been disposed.
Fatal signal 11 (SIGSEGV), code 1, fault addr 0xc in tid 25012 (pim_gss_ics.com)
findFocusedWindow: Found new focus @ 6 = Window{2b106d46 u0 pim_gss_ics.com/pim_gss_ics.com.main}
 

imbault

Well-Known Member
Licensed User
Longtime User
Thank you Erel,

I tried many stuff, but in the log I can see
Log("run ws")
last line of the web service call

and not the
Log("jobdone")
first line of JobDone

So, I'm lost....
 
Upvote 0

lemonisdead

Well-Known Member
Licensed User
Longtime User
Got something with some Samsung phones and the old http library, just an idea : it was about the chars encoding. And I notice that you have some spaces in your request like here ("<" & WS_to_call & " xmlns="). Could it be translated (or not) when you execute the job ?
 
Upvote 0

imbault

Well-Known Member
Licensed User
Longtime User
Upvote 0

imbault

Well-Known Member
Licensed User
Longtime User
Erel,

Same problem, no pb at all on a Galaxy S5, and many "the application as stopped" on the xCover....
 
Upvote 0
Top