This course will be retired on June 1, 2025.
Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
The Dark Sky service returns a string value representing the current weather icon. We need to customize our data model to convert this string representation into an icon provided by our designer.
Project Resources
Case Statements
case "rain":
iconId = R.drawable.rain;
break;
case "snow":
iconId = R.drawable.snow;
break;
case "sleet":
iconId = R.drawable.sleet;
break;
case "wind":
iconId = R.drawable.wind;
break;
case "fog":
iconId = R.drawable.fog;
break;
case "cloudy":
iconId = R.drawable.cloudy;
break;
case "partly-cloudy-day":
iconId = R.drawable.partly_cloudy;
break;
case "partly-cloudy-night":
iconId = R.drawable.cloudy_night;
break;
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up