Android Question Sending a crashreport [SOLVED]

AHilberink

Active Member
Licensed User
Longtime User
Hi,

I use this in my starter:
B4X:
'Return true to allow the OS default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
    ZendError(Error, StackTrace)
    Log("Crash")
    Return True
End Sub

Sub ZendError(Error As Exception, StackTrace As String)
    Dim HTTPError As HttpJob
    Dim Map1 As Map
    Dim JSONGenerator As JSONGenerator
    
    'generate JSON
    Map1.Initialize
    Map1.put("Version",Application.VersionName)
    Map1.put("Error",Error.Message)
    Map1.put("Stack",StackTrace)
    JSONGenerator.Initialize(Map1)
    
    Log(JSONGenerator.ToString)
    
    HTTPError.Initialize("",Me)
    HTTPError.PostString(xxxxxxxx,JSONGenerator.ToString)
    Wait For (HTTPError) JobDone(HTTPError As HttpJob)
    Log("Succes: "&HTTPError.Success)
End Sub
(In my code xxxxxxxx=url)

Will this be possible? Because on a crash it seems the HTTP is not done.

Kind regards,
André
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 1
Top