Android Question Error with HttpJob in https

Gktech

Member
Licensed User
I have a one request in the application via HttpJob was working normally after having installed a digital certificate on my website, started the error returns:

B4X:
org.json.JSONException: End of input at character 0 of

What can be done to solve the problem?
Help!
 

DonManfred

Expert
Licensed User
Longtime User
Hiding your code is a great help for us
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Dont expect me to make a project out of this text file!

Use File-Export as ZIP and upload this zip here which is a complete project which we could start and see the problem (hopefully).

Additionally you are not providing your layouts and also not your Databasefile

Spanish is not my native language. It´s like chinese... Hard to know what the subname suggests for a non spanish people
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
The uploaded file is too large.
B4X:
https://www.ijavendi.com.br/aplicativo/cadastro.php?acao=3i&d_perfil=
THIS is the page your app is requesting. Note that the sql query does not return a value.
The Server response is empty so the jsonparser crashes.

B4X:
Sub buscaIdComprador
    Dim Cursor1 As Cursor
    Cursor1 = SQL1.ExecQuery("SELECT id_perfil FROM config")
    For i = 0 To Cursor1.RowCount - 1
        Cursor1.Position = i
        id_perfil = Cursor1.GetString("id_perfil")
    Next
    Cursor1.Close
    Log("ID:"&id_perfil)
    Dim dados_perfil As HttpJob
    dados_perfil.Initialize("dados_perfil", Me)
    dados_perfil.PostString(servridor &"cadastro.php?acao=3", "id_perfil="& id_perfil)
  
End Sub

It prints
to the log....

Please note that in your code the "acao" is not send with POST. It is a GET variable as it is part of the URL.

I suggest to check you php file too
 
Last edited:
Upvote 0

Gktech

Member
Licensed User
B4X:
https://www.ijavendi.com.br/aplicativo/cadastro.php?acao=3i&d_perfil=
THIS is the page your app is requesting. Note that the sql query does not return a value.
The Server response is empty so the jsonparser crashes.

B4X:
Sub buscaIdComprador
    Dim Cursor1 As Cursor
    Cursor1 = SQL1.ExecQuery("SELECT id_perfil FROM config")
    For i = 0 To Cursor1.RowCount - 1
        Cursor1.Position = i
        id_perfil = Cursor1.GetString("id_perfil")
    Next
    Cursor1.Close
    Log("ID:"&id_perfil)
    Dim dados_perfil As HttpJob
    dados_perfil.Initialize("dados_perfil", Me)
    dados_perfil.PostString(servridor &"cadastro.php?acao=3", "id_perfil="& id_perfil)
 
End Sub

It prints to the log....

I am having problem in the Form module formPreferencia in the return of the 'profile_data'
Url example: https://www.ijavendi.com.br/aplicativo/cadastro.php?action=3&id_perfil=59
 
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Ignore: Out ninja'd

I have a one request in the application via HttpJob was working normally after having installed a digital certificate on my website, started the error returns:

B4X:
org.json.JSONException: End of input at character 0 of

What can be done to solve the problem?
Help!
Did you make your site SSL only (without redirecting HTTP)? If so you may need to change these
B4X:
Dim servridor As String: servridor = "http://ijavendi.com.br/aplicativo/"
Dim servridor_imagem As String: servridor_imagem = "http://ijavendi.com.br/admin/imagens-carro/"
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Upvote 0
Top