Skip to content
Snippets Groups Projects
Commit ab55e835 authored by Haug Michael's avatar Haug Michael
Browse files

small cleanup in weatherOutput

parent ce6c1c33
No related branches found
No related tags found
No related merge requests found
......@@ -23,8 +23,7 @@ public class Forecast {
SearchingAndComparing.MethodSearchingAndComparing();
CopyToFile.CopyURLToFile("weatherCache\\" + SearchingAndComparing.GetID() + ".json");
CopyToFile.CopyURLToFile("weatherCache\\" + SearchingAndComparing.GetID() + ".json");
CopyToFile.CopyFileToWeather();
......
......@@ -9,7 +9,7 @@ import java.util.Calendar;
public class CopyToFile {
public static String filePath;
static String filePath;
public static void CopyURLToFile(String pathname) {
......@@ -41,10 +41,10 @@ public class CopyToFile {
return weatherObject;
}
public static long test() {
/* public static long test() {
File fileTest = new File("weatherdata.json");
boolean ergebnis = fileTest.setLastModified(Calendar.getInstance().getTimeInMillis());
return fileTest.lastModified();
}
*/
}
\ No newline at end of file
......@@ -15,22 +15,21 @@ public class WeatherOutput {
for (int i = 0; i < weatherObject.getList().length - 1; i++) {
if ((weatherObject.getList()[i].getDtTxt().substring(11, 13).equals("00")) || i == 0 ) {
if ((weatherObject.getList()[i].getDtTxt().substring(11, 13).equals("00")) || i == 0) {
System.out.println(weatherObject.getList()[i].getDtTxt().substring(0, 10));
}
System.out.print(weatherObject.getList()[i].getDtTxt().substring(11, 13) + " Uhr: ");
// System.out.print(weatherObject.getList()[i].getDtTxt() + ": "); // output nicht wie bei Goik
// System.out.print(weatherObject.getList()[i].getDtTxt() + ": "); // output nicht wie bei Goik
/* double timeStamp = weatherObject.getList()[i].getDt();
timeStamp = timeStamp;
System.out.println(timeStamp);
// January 1, 1970 00:00:00.000 GMT */
Main MainWeatherData = weatherObject.getList()[i].getMain();
System.out.print(Math.round(MainWeatherData.getTemp()) + "°C,");
Clouds SkyCondition = weatherObject.getList()[i].getClouds();
int SkyPercent = SkyCondition.getAll();
System.out.print(Math.round(weatherObject.getList()[i].getMain().getTemp()) + "°C,");
int SkyPercent = weatherObject.getList()[i].getClouds().getAll();
if (SkyPercent < 25 && SkyPercent >= 0) {
System.out.print(" Klarer Himmel" + "\n");
} else if (SkyPercent > 25 && SkyPercent < 50) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment