Pointui » Home 2 Applets Showcase

[Applet] Weather from yr.no (VGA/QVGA)

(98 posts)
  1. tehamn
    Member

    This is a weather forecast applet for the Norwegian national weather forecast webservice yr.no. Please visit yr.no for information on the forecast. They have forecasts for a number of locations around the world and they come in english as well

    The current version is VGA only as I do not have a QVGA unit to test on


    The first page shows the next weather forecast period.
    The title is the current town
    yr.no does not provide current weather so this is the next period. (date and time is shown under the current town)
    The applet shows the weather icon, temperature, wind speed and direction, pressure, precipitation and sun up/down

    The small icon in the upper right hand corner is to refresh the weather forecast
    An auto update function is available. More on this later

    Clicking the yr.no logo will take you to the yr.no page for the current town (mobile page at m.yr.no)

    Clicking the weather icon will take you to the next page


    This page shows the weather forecast for the next 5 days (the 12:00 to 18:00 period for each day)
    The icon in the upper right hand corner takes you back to the first page

    Clicking on any of the small weather icons takes you to the detailed forecast for the respective day shown below.

    Setup:
    Unfortunately, there is no xml search page on yr.no for adding towns
    The only way is to edit the locations.xml file
    Edit the existing items or add more (don't know how many the list page can use).
    ID- Just use numbers in sequence
    Name- The name of the town shown in the applet
    loclink-the link of the weather forecast from yr.no. Just copy from the url field in the browser

    Click the title field with the name of the town to get to the select location page shown below.

    The settings.txt contains one user editable value: AutoUpdate.
    If set to 0, no automatic update is done
    If set to 1, the application will check if a new update should be ready. The forecast xml file contains a time for next update which the applet checks against when activated (No timers)

    I have included one english terms.xml and one norwegian. The screenshots are taken using the norwegian terms

    The applet is currently made for the WM7 theme

    Comments and suggestions would be appreciated

    Edit: Added QVGA graphic files. Extract zip to overwrite VGA files

    Edit: Added new version plus pngs for vga and qvga 11. June 2009
    Edit: Replaced cs file with bugfix as in post #47
    Edit: Added v1.6. Description of version in separate post

    Edit 21. June 09: Added 1.6 with all files for VGA. QVGA can use the old qvga.zip file with grapgics for QVGA

    Attachments

    1. YrWeather1.6_vga_all_files.zip (1297.9 KB, 1,114 downloads) 8 months old
    2. YrWeather1.6.zip (15 KB, 443 downloads) 9 months old
    3. YrWeather1.1.zip (1744.6 KB, 343 downloads) 9 months old
    4. vga_png.zip (1807.2 KB, 139 downloads) 9 months old
    5. qvga_png.zip (621.8 KB, 344 downloads) 9 months old
    6. qvga.zip (443.9 KB, 541 downloads) 9 months old
    7. Screen04.png (59 KB, 64 downloads) 9 months old
    8. Screen05.png (49.5 KB, 52 downloads) 9 months old
    9. Screen03.png (86.3 KB, 35 downloads) 9 months old
    10. Screen01.png (98.6 KB, 64 downloads) 9 months old
    Posted 9 months ago #
  2. woolflei
    Member

    great job

    Posted 9 months ago #
  3. fouad796
    Member

    very good :))

    Posted 9 months ago #
  4. reaper7
    Member

    Lovely work. (",)
    Can't seem to get my links working is this the correct format for Galway and Dublin -Ireland:

    ''<locations>
    <location>
    <id>0</id>
    <name>Galway</name>
    <loclink>http://http://www.yr.no/place/Ireland/Galway/Galway/</loclink>
    </location>

    <location>
    <id>1</id>
    <name>Dublin</name>
    <loclink>http://www.yr.no/place/Ireland/Dublin/Dublin/</loclink>
    </location>
    </locations>''

    Edit: Ah think I spotted the problem Had http://http:// in the first one.

    Posted 9 months ago #
  5. tehamn
    Member

    I can see that you have a double http:// on the Galway link
    It worked for me when I removed this

    Edit: Saw you spotted it yourself

    Posted 9 months ago #
  6. Mange takk tehamn!
    Very nice weather applet, data seem accurate.

    >>> Added to the Applets Store

    Posted 9 months ago #
  7. The Dark Lestat
    Member

    QVGA PLZ!!!! ill test for you if you need a tester!

    Posted 9 months ago #
  8. Jasper_jt
    Member

    I wondered why the applet worked weird for me ;) I changed the cities in locations.xml, including location 0, added some more in locations 1 and 2. And applet got hiccup ;) Well, I forgot to change also location in settings.txt to location 0 I had chosen. Please be aware of that ;)

    The forecast is truly nice, complex, split per hours, wind, falls... I really like it! Thank you for that. It's sorry, that locations have to be added and changed manually in files. If that part would be improved, then applet is perfect :)

    Posted 9 months ago #
  9. tehamn
    Member

    The Dark Lestat:
    I'll try to get out a QVGA version but my problem is that I do not have a QVGA unit to check the visuals on. I have tried to make it QVGA compliant by using Device.AutoScaleValue() wherever possible so I think the main job is to resize the graphic files but I am not sure of this.

    Posted 9 months ago #
  10. tehamn
    Member

    Jasper_it:
    The only way to search yr.no for locations is currently on the webpage. It is possible that I can decode the results from the html page so I will look into it. The alternative is to use the text files that they provide for download but these will only give you a few of the available locations so I don't think this is a very good solution.

    As for your problem when you changed all locations, it should be possible to just change by clicking on the blue button with the location name, shouldn't be necessary to manually edit the settings.txt file. But maybe I should check if the current location is present in the xml file and choose the first one in the xml file if the current location is not there?

    Posted 9 months ago #
  11. Jasper_jt
    Member

    @tehamn - I fully understand the reasons for the manual setup :) It's fine! Managable.
    According to location - nop - the original position nr 0 (Stavanger) refered to settings of the same city. Thus I had to change dafault city in settings exactly to the same as position 0. Anyway, it works and buzz now :)

    Posted 9 months ago #
  12. markdaams
    Member

    I'd also like to have a QVGA version of this one. It looks very good.

    Posted 9 months ago #
  13. eddym
    Member

    I tried to see if the app would work in QVGA, so I resized the jif's, using the tools available in this community. All the pictures are now watermarked, so hard to read, but it seems everything is fine. So if tehamn could release the original PNG files, it is an easy job to convert. Well done tehamn for writing your app in this way!

    Attachments

    1. Screen01.jpg (39.8 KB, 0 downloads) 9 months old
    Posted 9 months ago #
  14. tehamn
    Member

    I am currently at work and do not have the files here.
    I found this tool
    http://emerym.homeip.net/rlToday/upload.cgi

    I guess if I run this on the png files it should be a quick job to get QVGA up running.
    Will do this later tonight.

    Edit: Thanks for testing eddym.
    Edit again: Looks like the tool only works with rlToday.

    Posted 9 months ago #
  15. eddym
    Member

    I resized the pictures using Irfanview for the non regular ones and the XP builtin resize pictures for the Icons and arrows.

    Posted 9 months ago #
  16. tehamn
    Member

    Here's the qvga jifs.
    I have resized to 50% using Corel Paintshop Pro
    Can someone please test and see if these are good?

    It should be ok to just replace the vga jifs with the ones in this file

    I will try to make the next version generic with both types included

    Attachments

    1. qvga.zip (443.9 KB, 35 downloads) 9 months old
    Posted 9 months ago #
  17. eddym
    Member

    tehamn, yoy have done a great job. Everything is also fine on QVGA, first time right!

    Posted 9 months ago #
  18. markdaams
    Member

    Yep, the QVGA version works like a charm. Thanks!

    Posted 9 months ago #
  19. arvid
    Member

    great job ....

    Posted 9 months ago #
  20. trondis23
    Member

    Thank you! QVGA works for me too. I entered some Norwegian cities, but forgot at first to save as UTF8. But after I changed this the cities with æ, ø or å shows up. Interesting - I have now 4 diffent weather applets up showing the temperature for my city. All are different. They show 10, 11, 13 or 14 degrees Celsius. One show rain, one thunder and two show clouds only. I haven't checked the actual temperature outside my window, but yr.no is correct about the rain.

    Posted 9 months ago #
  21. markdaams
    Member

    I don't know if anyone is interested but I thought the blue color of the applet didn't really go with my main theme so I made a "black" theme for this applet for QVGA. Here are a couple of screenshots from my 320x320 pixels phone.

    Just replace the original jif files with the ones from the zip file below.

    [Edit:] Added theme for Applet version 1.1

    Attachments

    1. Screenshots.png (174 KB, 4 downloads) 9 months old
    2. YrWeather_1.0_-_QVGA_black_theme.zip (4.9 KB, 4 downloads) 9 months old
    3. YrWeather_1.1_-_QVGA_Black_theme.zip (5.7 KB, 45 downloads) 9 months old
    Posted 9 months ago #
  22. eddym
    Member

    Maybe you can also do the bgroundlarge.jif?

    Posted 9 months ago #
  23. xpres
    Member

    lol markdaams you beat me to it... i was doing the same thing. oh well, if anyones interested :P
    I didnt change the weather icons etc, only the bg and buttons. Also redid the numbers.

    Just unzip and replace the files.
    Awesome app btw, tehamn! Amazing detail. Was waiting for something like this. There are some problems though, like the updated: time, for me its about 8 hours behind my actual time. maybe its setting time specifically according to your location? im GMT +6 btw. I'll also put it a request to change windspeed from m/s to km/h.

    Attachments

    1. qvga_skin.zip (10.2 KB, 36 downloads) 9 months old
    2. preview.JPG (66.8 KB, 5 downloads) 9 months old
    Posted 9 months ago #
  24. eddym
    Member

    I think, the updated time you see is the time as it is given by yr.no, so when they last updated the forecast, not the time you have pushed the update button.

    Posted 9 months ago #
  25. xpres
    Member

    hmm youre right it matches the one on the website. but that again raises the question, is it according to my time? because the website says it updated it last at 12:24, n next update is at 1:00. thats quite far away, according to my time, n 1224 was very long ago, according to my time.
    Anyway, its still the best weather app, will take some time to see the accuracy, as I havent used this site(yr.no) before.

    Posted 9 months ago #
  26. eddym
    Member

    Maybe tehamn can insert this stringconversion in his code
    '
    string mps2kmh(string mps)
    {
    int h = 0;
    float f =0;
    f = mps;
    f *= 3600;
    f /= 1000;
    result = f.ToString("%.0f");
    return result;
    }

    '
    or this

    '
    string mps2knt(string mps)
    {
    int h = 0;
    float f =0;
    f = mps;
    f *= 3600;
    f /= 1852;
    result = f.ToString("%.0f");
    return result;
    }
    '

    for the sailors amongst us.
    And make it selectable in settings.txt?
    I have added one which shows knots for the Windspeed.

    Attachments

    1. YrWeather_kn.zip (9.4 KB, 11 downloads) 9 months old
    Posted 9 months ago #
  27. tehamn
    Member

    Thanks markdaams and xpres for themes.
    I am not a graphical designer so its good to get some help.
    I have no problems with posting the original pngs if anyone is interested

    As for the update time, xpres
    http://www.yr.no/place/Pakistan/Punjab/Rāwalpindi_Cantonment/varsel.xml
    The above link is the xml file that is for this location
    All times in this file is local times for the forecast location

    Looks like the update frequency for some locations is about 2 times a day
    In Norway, where I and the service is located gets an update 4 times a day.

    The label with last updated shows the value from the xml file, not the time you last pressed the update button.
    If you leave autoupdate on it will check against the nextupdate time in the xml file and do an automatic update if the unit time has passed this value. No need for timers when they provide you with the next time an update is available.
    If the update is not ready, it will try every activation time until a new update is received.

    Posted 9 months ago #
  28. tehamn
    Member

    eddym: I will try to make this configurable in the next version

    yr.no gives all values in metric (they are Norwegian based) so I have to do the maths in the applet

    Posted 9 months ago #
  29. tehamn
    Member

    Another thing I am working on is to get the meteogram from the weather forecast into the applet. I have succeded in downloading and showing the image.

    http://www.yr.no/sted/Norge/Rogaland/Stavanger/Stavanger/meteogram.png

    The main problem is the form factor of this image.
    Is there any way of panning an image that is much larger than the screen?
    Maybe swiping?

    I guess one way of doing it is to reload with different clipping based on user tapping some controls.

    Posted 9 months ago #
  30. xpres
    Member

    Yep now I see, it does only update twice a day. Thanks for all the info.
    The meteogram would be an excellent addition. I dont really know much programming, but an easy way might be to scale its height to 210(making width 640) and display it fullscreen in landscape mode. Then it could be displayed simply in vga, n for us qvga folks, it could be scrolled through by simple arrows on both sides, needing alittle more than two screens. dont know if thats easily implementable though.
    Another request btw, hope you dont mind. Direct buttons for next and previous day in the large detail view would be great.
    Waiting patiently for the next version :D

    Posted 9 months ago #

RSS feed for this topic

Reply »

You must log in to post.