Arnaud Active Member Licensed User Longtime User May 10, 2016 #1 Hello, I search a code example in B4A to receive weather based on GPS position, GPS coordinate. The best exemple is AHWeather (https://www.b4x.com/android/forum/threads/weather-app.10919/) I don't find code for weather, only APPs shared in "Share my creation", but without source/code/Example... I tried ICOSWorldForecast 3.50 but without success... Maybe anyone can help me please? Thank you very much. Arnaud
Hello, I search a code example in B4A to receive weather based on GPS position, GPS coordinate. The best exemple is AHWeather (https://www.b4x.com/android/forum/threads/weather-app.10919/) I don't find code for weather, only APPs shared in "Share my creation", but without source/code/Example... I tried ICOSWorldForecast 3.50 but without success... Maybe anyone can help me please? Thank you very much. Arnaud
somed3v3loper Well-Known Member Licensed User Longtime User May 10, 2016 #2 You can use httputils with services like this one http://api.wunderground.com/auto/wui/geo/GeoLookupXML/index.xml?query=37.76834106,-122.39418793 and you have to parse result in JobDone sub Note that this service will change "This feed will be deprecated. Please switch to http://www.wunderground.com/weather/api/" Upvote 0
You can use httputils with services like this one http://api.wunderground.com/auto/wui/geo/GeoLookupXML/index.xml?query=37.76834106,-122.39418793 and you have to parse result in JobDone sub Note that this service will change "This feed will be deprecated. Please switch to http://www.wunderground.com/weather/api/"
S susu Well-Known Member Licensed User Longtime User May 11, 2016 #3 You can try Forecast.io API "The Forecast API allows you to look up the weather anywhere on the globe, returning (where available): Current conditions Minute-by-minute forecasts out to 1 hour Hour-by-hour forecasts out to 48 hours Day-by-day forecasts out to 7 days' It's free for 1,000 calls/day and after that $0.0001 each. https://developer.forecast.io Upvote 0
You can try Forecast.io API "The Forecast API allows you to look up the weather anywhere on the globe, returning (where available): Current conditions Minute-by-minute forecasts out to 1 hour Hour-by-hour forecasts out to 48 hours Day-by-day forecasts out to 7 days' It's free for 1,000 calls/day and after that $0.0001 each. https://developer.forecast.io
Arnaud Active Member Licensed User Longtime User May 11, 2016 #4 Thank you for your help, it is a success, I receive weather depends coordinates !! Thank you very much, Upvote 0
Thank you for your help, it is a success, I receive weather depends coordinates !! Thank you very much,
microbox Active Member Licensed User Longtime User Jun 27, 2016 #5 chardenal said: Thank you for your help, it is a success, I receive weather depends coordinates !! Thank you very much, Click to expand... Hi, I just want to ask if you can share a simple code how to get the weather info? Thanks, joe Upvote 0
chardenal said: Thank you for your help, it is a success, I receive weather depends coordinates !! Thank you very much, Click to expand... Hi, I just want to ask if you can share a simple code how to get the weather info? Thanks, joe
Arnaud Active Member Licensed User Longtime User Jul 14, 2016 #6 Hi Joe, here an example: Sub recuperation_meteo Dim job As HttpJob job.Initialize("JobMeteo", Me) job.Download("http://api.wunderground.com/api/xxxxxxxxxxxxxx/geolookup/conditions/lang:FR/q/"&Latitude&","&Longitude&".xml") end sub Sub JobDone(job As HttpJob) If job.JobName="JobMeteo" And job.Success=False Then Log("No Internet connection") Else Dim retour_meteo As String '-------------- save retour fichier xml --------------------------------- retour_meteo=job.GetString File.WriteString(File.DirDefaultExternal,"meteo.xml",retour_meteo) End If job.Release End Sub xxxxxxxxxxxxxx is your Forecast API. Arnaud Upvote 0
Hi Joe, here an example: Sub recuperation_meteo Dim job As HttpJob job.Initialize("JobMeteo", Me) job.Download("http://api.wunderground.com/api/xxxxxxxxxxxxxx/geolookup/conditions/lang:FR/q/"&Latitude&","&Longitude&".xml") end sub Sub JobDone(job As HttpJob) If job.JobName="JobMeteo" And job.Success=False Then Log("No Internet connection") Else Dim retour_meteo As String '-------------- save retour fichier xml --------------------------------- retour_meteo=job.GetString File.WriteString(File.DirDefaultExternal,"meteo.xml",retour_meteo) End If job.Release End Sub xxxxxxxxxxxxxx is your Forecast API. Arnaud