Spanish Consulta: Enviar cada x segundos

marbellapc

Member
Licensed User
Longtime User
Buenas a todos, yo para el que no sepa estoy liado con las funciones de GPS, he utilizado el ejemplo que hay aqui en el foro y necesito un poco de ayuda.
Tengo el siguiente codigo:
B4X:
Sub GPS_LocationChanged (Location1 As Location)
    Dim GPS_Speed As String
       GPS_Speed       = 3.6 ' ------------------------------------------------------------ Velocidad: 1 m/s equivalen a 3.6 Km/h.   
      Speed           = location1.Speed * GPS_Speed ' ------------------------------------ Multiplicamos m/s por los Kilometros hora.  
   lblLat.Text         = "    " & Location1.ConvertToSeconds(Location1.Latitude) '--------- Latitud en Decimal.
   lblLon.Text         = "    " & Location1.ConvertToSeconds(Location1.Longitude) ' ------- Longitud en Decimal.
   lblSpeed.Text       = "    " & Speed & " Km/h" 
' ------------------------------------------------------------------------------------------ INICIO: Enviar datos via web.
    WebView_url.LoadUrl("http://maps.google.es/maps?hl=es&ll="&Location1.Latitude&","&Location1.Longitude)
End Sub

El cual envia la longitud y la latitud a una url, ahora mismo como vereis la manda a Google Maps, cuando pauso el GPS me posiciona con las coordenadas que envia, pero claro no consigo que lo haga cada 10, 15 o 20 segundos, he intentado con un TIMER sin resultados positivos, he preguntado en el foro ingles y me han comentado que en vez de un TIMER utilize un datetime.now... ufff he estado mirando y mirando pero no me aclaro.

Mi consulta es, podeis poner un ejemplo sencillo para ver como funciona, porque como digo por mas que he intentado integrarlo en el proyecto utilizando los ejemplos que he visto por ahi, no he conseguido nada.

Saludos y gracias anticipadas por vuestro tiempo.
 

klaus

Expert
Licensed User
Longtime User
Attached an example program that shows a solution.
To start or stop the GPS use the menu.
There is also a menu function to change the location for testing.
The map update is awfully slow on my device (Nexus one).
The timing for the GPS is defined in: GPS1.Start(20000, 5), 20000 means every 20 seconds and 5 means 5 meters of position change.

Best regards.
 

Attachments

  • GPSGoogle.zip
    6.8 KB · Views: 355

marbellapc

Member
Licensed User
Longtime User
Thank you very much Klaus, I have been very helpful your example, this very clear and very simple to understand for those who still have not mastered this world, again not that I can only congratulate you and thank you for your help.

regards

P. S. Sorry for my English, I speak not as good as they should.

---------------------------------------

Muchas gracias Klaus, me ha sido de mucha ayuda tu ejemplo, esta muy claro y es muy sencillo de entender por los que todavia no dominamos este mundillo, de nuevo no me queda mas que felicitarte y darte las gracias por tu ayuda.

Saludos

P.D. Perdon por mi ingles, no lo hablo todo lo bien que debiera.
 
Top