User Tools

Site Tools


agl-demonstrator:weather

This is an old revision of the document!


Weather

Summary

Weather is an HTML5 application that subscribes to the AccuWeather to provide location based weather data using a simple RESTful web interface. This PoC is used to demonstrate the utilization of such services as AccuWeather and to provide a base weather application on the Tizen platform.

Features include

  • Current date and time
  • Current weather conditions
  • Current temperature
  • 5 day forecast
  • Hourly forecast
  • Severe Weather Alerts
  • Location management
    • Lookup locations
    • Save locations
    • Reorder
    • Delete

Resources

Watch .

Access the .

Access the .

Download the .

What the app does

To launch the Weather application, the user touches the weather icon if it is on the top bar. This is an official Accuweather stylized sun, approved by Accuweather. The application can also be launched through the Application Screen by tapping the icon there. The default location that is always available is the current location, which should be provided by the geolocation feature (please see Part 4: Known Bugs, where the Tizen bug that affects the geolocation feature is further mentioned).

Up to four other locations can be added and saved by tapping the Add Location button (+) in the lower right hand corner. Locations may be queried by city name, city name and zip/postal code, or just the zip/postal code. If the user isn’t specific enough, up to three locations will be displayed to choose from. Once one or more locations have been entered, the user can delete a location by tapping the Delete Location button (-) in the lower left hand corner. The default current location cannot be deleted. The Weather application features HTML5 storage to remember a user’s location choices. If the user exits the application and re-launches, the locations previously chosen will be displayed again. To view the current conditions for a location, a user can tap the location name and the humidity, wind speed and direction, and AccuWeather’s patented RealFeel are displayed.

To view the hourly forecast for a location, a user can swipe the location towards the right. The details for the hour, a weather icon graphic, a brief weather description, and the predicted hourly temperature are displayed. To view the 5-day forecast, swipe towards the left. Displayed there is the day of the week including the current day (Today), the date, a brief weather summary for the day, and the predicted high and low temperature for that day.

Severe weather alerts are determined by whether or not forecasted weather meets or exceeds a specific threshold. The application checks the API every 5 minutes, and if an alert has been issued by the AccuWeather API, the application can interrupt other applications with a pop-up. The details displayed are a localized description such as “Severe Thunderstorms”, the category, the area, the source of the report, and a detailed text description.

Technical Details

The sections below are taken from directions for what is known as the Tizen IVI 3.0-M2-EOY (commonly called 'the Jan. 15 image'. The current Tizen release is dated 2014.01.14, and may require some adjustment.

Installation Prerequisites

The following installation directions take the base Tizen image, or the user must run the application from the command line using the Tizen terminal and an external keyboard.

Instructions for debugging WRT Apps on Tizen IVI (installation, removal, and deployment)

Tizen IVI WRT applications are built into widget ('.wgt') files for deployment (a format based on the W3C widget specification, see http://www.w3.org/TR/widgets/ for more information). Once you have built or received the widget files for one or more applications that you wish to deploy and run, the next step is to copy them onto the target device. Common options for this would be tools like scp/sftp (in a Linux/Unix environment), FileZilla (Windows and Mac) or Cyberduck (Mac).

Once the .wgt files have been transferred to the target machine, they may be installed, launched and uninstalled.

To get a list of currently installed applications, use the following command from a terminal (or remote shell/ssh session) on the target hardware (log in as root with the password tizen):

root:~> wrt-launcher -l

This will produce output similar to the following:

No Name Version GUID Package ID App ID
1 saythis 1.0.0 http://yourdomain/sayThis lYjFlj49Q4 lYjFlj49Q4.saythis
2 Settings 1.0.0 http://yourdomain/Settings ODBQpKvkS1 ODBQpKvkS1.Settings
3 MediaPlayer 1.0.0 http://yourdomain/MediaPlayer t8j6HTRpuz t8j6HTRpuz.MediaPlayer
4 Store 8.2.4401 http://com.intel.tizen/store intelPoc13 intelPoc13.Store
5 Phone 12.1.3750 http://com.intel.tizen/phone intelPoc15 intelPoc15.phone

If the application you wish to install is not already installed, simply enter (using d1RlEaxhZb.Fingerprint.wgt as an example):

root:~> wrt-installer -i Weather.wgt

If successful, you should see output such as the following:

===========================================================
   # wrt-installer #
   # argc [3]
   # argv[0] = [wrt-installer]
   # argv[1] = [-i]
   # argv[2] = [Weather.wgt]
   ## wrt-installer : intelPoc31.Weather.wgt installation was successful.
   ===========================================================

If unsuccessful, you may see errors such as 'invalid widget package', 'privilege level violation' or, if the application is already installed (and its widget file was built with a different signature than the one you wish to install), 'invalid signature'. The first two errors are out of scope for this document.

If you see 'invalid signature', and the widget file has to your knowledge been created with a valid signature, the likely cause is a conflict between the signature of the currently installed version and that of the new version. Though both signatures may be valid, the system treats the upgrade of an existing package with a different signature as a security violation. To work around this issue, simply uninstall the application and subsequently install the new version:

root:~> wrt-installer -un intelPoc31.Weather.wgt      <-- note: use the App ID when 
un-installing and the full widget filename when installing

If the uninstall is successful, you should see output like the following:

===========================================================
   # wrt-installer #
   # argc [3]
   # argv[0] = [wrt-installer]
   # argv[1] = [-un]
   # argv[2] = [intelPoc31.Weather.wgt]
   ===========================================================
   ## wrt-installer : intelPoc31.Weather.wgt un-installation was successful.

Refer to installation instructions above for the subsequent installation steps.

In order to launch and run an installed application, issue the following command with the application's App ID as an argument:

root:~> wrt-launcher -s intelPoc31.Weather.wgt

You should see the application start and run on the target device.

To launch the application in debug mode, add the '-d' flag:

root:~> wrt-launcher -d -s intelPoc31.Weather.wgt

This will produce output like the following:

root:~/wgt> wrt-launcher -d -s intelPoc31.Weather.wgt
   port: 36070
   result: launched

The port number referenced is a random high port which allows one to connect to the target device with a web browser using a URL of the form:

http://&lt;ip address or name of target device>:<port #>

For example:

http://192.168.1.223:36070

Once connected, you should see a single link in the upper right of the resulting web page, e.g.:

file:///opt/usr/apps/intelPoc31/res/wgt/index.html

Clicking that link will launch Webkit Web Inspector, a set of web development tools that should look familiar to users of Firefox Firebug or Chrome Dev Tools. Click the 'Console' icon in the toolbar to go to the Javascript console. Press ctrl-R, or type:

window.location.reload();

…to reload the application in order to display the startup/initialization functions associated with the app (since the app has already started by the time the debug interface is available).

To exit a running application, issue the following command with the application's App ID as an argument:

root:~> wrt-launcher -k intelPoc31.Weather

Instruction to the console:

Assumptions these are all running from the Tizen platform and can access the console by SSH command or Control ALT F4 for a terminal. Tizen instructions are at Tizen.org

Install

wrt-installer -i intelPoc31.Weather.wgt

Launch

wrt-installer -i intelPoc31.Weather.wgt

Known Bugs

Issue Type Key Summary
Bug 67 GPS location doesn’t currently work due to a bug in Tizen IVI (TIVI-2402). Currently the geolocation in Weather is hardcoded to a set of coordinates. This will be fixed in a future release. There must also be a means to test this feature in a vehicle, such as a software driver that bridges the Tizen device to the vehicle
Bug 19 Severe weather alerts do not remember previously viewed alerts – alerts that have been previously dismissed will appear again at regular intervals
Bug 68 At times the weather will get stuck on hourly forecast. This likely a result of somehow iScroll getting set to Zero width so it is not able to scroll back to the city or daily forecast

Release History

Features

Weather allows a user to store up to 4 selected locations discovered through Accuweather’s API as well as providing the default or current location. Each location’s information is updated at regular intervals and provides a 5-day forecast, hourly forecast, and current conditions. Severe weather alerts are displayed if current conditions for the default location meet or exceed a certain threshold.

Bug Fixes

Initial release

Key Summary
TC-185 webkit-efl pkg update fails to build for emulator
TC-249 libdrm submit/tizen/20140324.044735 submission causes emulator-yagl and webkit-efl to fail for emulator
TC-2144 Tizen Web Apps segfault on $.ajax queries to https requests
TC-2122 Unable to get Gps info by Gps NMEA source plugin
PTREL-656 gps-manager doesn't build against Tizen generic
TC-516 Need NMEA source plugin for AMB
TIVI-1931 Contacts-service (contacts-service-0.9.84.2-6.1.src.rpm) has broken several package builds
agl-demonstrator/weather.1439075020.txt.gz · Last modified: 2015/08/08 23:03 by wminer