Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Creating the Model, Current Weather first step, simple
- package com.teamtreehouse.stormy;
- public class CurrentWeather {
- private String mIcon; // The Icon // it comes from Forecast API as a string, we convert it to an int
- private long mTime; //Time
- private double mTemperature; //Temp
- private double mHumidity; //humidity
- private double mPrecipChance; //chance of precipitation
- private String mSummary; //summary at the bottom
- // Step 2: Generate getters and setters for everything: Code>Generate...>Getters and Setters:
- public double getHumidity() {
- return mHumidity;
- }
- public void setHumidity(double humidity) {
- mHumidity = humidity;
- }
- public String getIcon() {
- return mIcon;
- }
- public void setIcon(String icon) {
- mIcon = icon;
- }
- public double getPrecipChance() {
- return mPrecipChance;
- }
- public void setPrecipChance(double precipChance) {
- mPrecipChance = precipChance;
- }
- public String getSummary() {
- return mSummary;
- }
- public void setSummary(String summary) {
- mSummary = summary;
- }
- public double getTemperature() {
- return mTemperature;
- }
- public void setTemperature(double temperature) {
- mTemperature = temperature;
- }
- public long getTime() {
- return mTime;
- }
- public void setTime(long time) {
- mTime = time;
- }
- }
- simple
- // https://teamtreehouse.com/library/build-a-weather-app/working-with-json/creating-the-model
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement