Back to project page Android_Sunshine_Tutorial.
The source code is released under:
GNU General Public License
If you think the Android project Android_Sunshine_Tutorial listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.androidtutorialsunshine; /* w w w.j ava 2s . com*/ import java.text.SimpleDateFormat; import java.util.Date; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; //Passing in a string form of the JSON returned by the api call public class WeatherDataParser { public static double getMaxTemperatureForDay(String weatherJSONString, int dayInfo) throws JSONException{ JSONObject weather = new JSONObject (weatherJSONString); JSONArray days = weather.getJSONArray("list"); //JSONObject dayInfo = days.getJSONObject(dayIndex); //JSONObject temperatureInfo = dayInfo.getJSONObject("temp"); //return temperatureInfo.getDouble("max"); return 2.0; } }