Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Kiriakos_T_
Beginner
137 Views

Intel XDK weather forecast

I want to implement to my application built in Intel XDK a weather forecast widget that shows the weather in the current location of the device using the GPS. Can anybody suggest a methology about it? Are the web services of Intel XDK appropriate for doing this? Is there any way to use accuweather API in XDK?
 

Tags (2)
0 Kudos
7 Replies
Alex_Hang
New Contributor II
137 Views

Hello sir,

If you want to show the weather in your current location you can use the AccuWeather widget for HTML. 

http://www.accuweather.com/en/free-weather-widgets/linked

Just personalize it how you want from that webpage, select the location type to auto-detect, generate your widget and just copy-paste the code they give you in your app where you want it to appear.

Kiriakos_T_
Beginner
137 Views

Thank you very much for this information alex.. there is only one small problem.. I can see the result in the simulator but not in the intel app preview in my mobile.. It only appears the message "loading widget.." I put this code in the body and the script tag in the head, right? is anything wrong with this?

Kiriakos_T_
Beginner
137 Views

The problem still remains.. the accuweather widget don't show up in the app after the build.. any ideas why this is happenning?

Alex_Hang
New Contributor II
137 Views

Hello sir, and sorry for the late reply.

I don't know why the widget is not visible on your app Preview, but I want to ask you if you built your app and tested it on your device. Please make sure you have an Internet connection.

If that doesn't work either, I think I found a solution to your problem. Instead of using the classic system that is using script and div tags, you can use the Iframe . You can add an Iframe from the App designer, or by inserting the given code in you app. Here is a link to a weather service that uses an Iframe to provide you with the weather forecast widget. https://blog.darksky.net/forecast-embeds/ They are other Iframe services on the web, but I hope this one will work.

                                                                                                                               Alex Hang

Kiriakos_T_
Beginner
137 Views

yes I built the app and run it in my mobile but only the message "loading widget" appears istead of the widget itself.. I can see it properly only in simulator.. as far as the iframe is concerned how can this work by taking my location automatically?

Alex_Hang
New Contributor II
137 Views

Here is an Iframe Weather service which auto-detects your location. It can display the weather from a specific location, or from your location

https://www.meteoblue.com/en/weather/widget/setupthree/bucharest_romania_683506

You can customize it how you want, this is the page which teaches you how to personalize it https://content.meteoblue.com/ro/help/products/widget

Kiriakos_T_
Beginner
137 Views

Alex thank you very much.. you were utmost helpful.. I appreciate your help..

Reply