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?
If you want to show the weather in your current location you can use the AccuWeather widget for HTML.
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.
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?
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.
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?
Here is an Iframe Weather service which auto-detects your location. It can display the weather from a specific location, or from your location
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