Umbrella (Android)

Android, Java, Picasso library, OkHttp library and Weather Underground’s API 

Weather Underground’s API provides free access to their service for developers.  http://www.wunderground.com/weather/api/

For this code challenge, I create a simple weather application named “Umbrella”.

  • Hourly Weather Display

The hourly weather has two main sections. The top section is the current conditions of the entered ZIP code. If the temperature is below 60˚, use the cool color as specified by the designs. If the temperature is 60˚ or above, use the warm color as specified by the designs.

  • User Settings

Screenshot_20170905-230338

– Zip Code Entry

The user should be able to enter the ZIP code as prescribed by the designs.

– Temperature Units Setting

Be able to switch between Imperial and Metric representation of the data.

  • Scrollable

 

Edit Text Preference Constraints

github: T06.10- EditTextPreferenceConstraints

* The below material is from Udacity Nanodegree Program- Become an Android Developer *

Setting an acceptable range

To limit the acceptable values between 0 (non inclusive) and 3 (inclusive) we opted to use a PreferenceChangeListener – this is not the same as a SharedPreferenceChangeListener. The differences are:

  • SharedPreferenceChangeListener is triggered after any value is saved to the SharedPreferences file.
  • PreferenceChangeListener is triggered before a value is saved to the SharedPreferences file. Because of this, it can prevent an invalid update to a preference. PreferenceChangeListeners are also attached to a single preference.

Continue reading