Hello everyone..
I'm new to B4A and I think this is very nice program but now I run into trouble.
The code use php and make a post request to a server.
I need help to understand why my code work in NOX player but not when I connect my Android phone with B4A Bridge.
I got it work on the phone but 3 days ago it's not work any more.
Maybe I have change some setups but I start to get crazy and really need some help.
I'm new to B4A and I think this is very nice program but now I run into trouble.
The code use php and make a post request to a server.
I need help to understand why my code work in NOX player but not when I connect my Android phone with B4A Bridge.
I got it work on the phone but 3 days ago it's not work any more.
Maybe I have change some setups but I start to get crazy and really need some help.
Get Data from mysql:
Sub Read_data
Try
'Dim PageServer As String = "http://iotproyecto.epizy.com/datasend.php"
'iotproyecto.epizy.com/datasend.php?act=Save&ppm=4.66&tem=57.8&rad=200
Dim PageServer As String = "http://gatetec.se/bidata/datasend.php"
'PageServer = "http://gatetec.se/bidata/datasend.php"
'inserta todas las Filas
Dim js As HttpJob
js.Initialize("", Me)
js.download2(PageServer, Array As String ("act", "R1"))
Wait For (js) JobDone(js As HttpJob)
If js.Success Then
Dim res As String
res = js.GetString
Dim parser As JSONParser
parser.Initialize(res)
If res <> False Then
Dim Tabla As List
Tabla = parser.NextArray
Dim Fila As Map
Dim Temp,ppm,fecha,radiacion, salida As String
'Select N,`fecha`,`ppm`,`temperatura`,`radiacion` From `tabla` order by N Desc Limit 1
For i=0 To Tabla.size-1
Fila = Tabla.Get(i)
Temp = Fila.Get("temperatura")
ppm = Fila.Get("ppm")
radiacion = Fila.Get("radiacion")
fecha = Fila.Get("fecha")
salida = "Fecha: " & fecha & CRLF _
& "Temp: " & Temp & CRLF _
& "ppm: " & ppm & CRLF _
& "radiacion: " & radiacion
MsgboxAsync(salida,"Datos Leidos")
MsgboxAsync(Temp,"Datos Leidos")
Next
End If
End If
Catch
Log(LastException)
End Try
End Sub