From 29952556c29a8965e205873d7429bd74ec6133b8 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sat, 22 Nov 2014 15:08:36 +0100 Subject: [PATCH] Do not pass through the OpenWeatherMap proxy cache --- .../weather/information/fragment/current/CurrentFragment.java | 3 +-- .../weather/information/fragment/overview/OverviewFragment.java | 3 +-- .../weather/information/notification/NotificationIntentService.java | 3 +-- .../name/gumartinm/weather/information/widget/WidgetIntentService.java | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/name/gumartinm/weather/information/fragment/current/CurrentFragment.java b/app/src/main/java/name/gumartinm/weather/information/fragment/current/CurrentFragment.java index b0791a9..0d04dc4 100644 --- a/app/src/main/java/name/gumartinm/weather/information/fragment/current/CurrentFragment.java +++ b/app/src/main/java/name/gumartinm/weather/information/fragment/current/CurrentFragment.java @@ -426,8 +426,7 @@ public class CurrentFragment extends Fragment { final String APIVersion = localContext.getResources().getString(R.string.api_version); final String urlAPI = localContext.getResources().getString(R.string.uri_api_weather_today); final String url = weatherService.createURIAPICurrent(urlAPI, APIVersion, latitude, longitude); - final String urlWithoutCache = url.concat("&time=" + System.currentTimeMillis()); - final String jsonData = HTTPClient.retrieveDataAsString(new URL(urlWithoutCache)); + final String jsonData = HTTPClient.retrieveDataAsString(new URL(url)); return weatherService.retrieveCurrentFromJPOS(jsonData); } diff --git a/app/src/main/java/name/gumartinm/weather/information/fragment/overview/OverviewFragment.java b/app/src/main/java/name/gumartinm/weather/information/fragment/overview/OverviewFragment.java index e3c6418..e102f80 100644 --- a/app/src/main/java/name/gumartinm/weather/information/fragment/overview/OverviewFragment.java +++ b/app/src/main/java/name/gumartinm/weather/information/fragment/overview/OverviewFragment.java @@ -352,8 +352,7 @@ public class OverviewFragment extends ListFragment { final String APIVersion = localContext.getResources().getString(R.string.api_version); final String urlAPI = localContext.getResources().getString(R.string.uri_api_weather_forecast); final String url = weatherService.createURIAPIForecast(urlAPI, APIVersion, latitude, longitude, localContext.getString(R.string.weather_preferences_day_forecast_fourteen_day)); - final String urlWithoutCache = url.concat("&time=" + System.currentTimeMillis()); - final String jsonData = HTTPClient.retrieveDataAsString(new URL(urlWithoutCache)); + final String jsonData = HTTPClient.retrieveDataAsString(new URL(url)); return weatherService.retrieveForecastFromJPOS(jsonData); } diff --git a/app/src/main/java/name/gumartinm/weather/information/notification/NotificationIntentService.java b/app/src/main/java/name/gumartinm/weather/information/notification/NotificationIntentService.java index 0c52886..64502dd 100644 --- a/app/src/main/java/name/gumartinm/weather/information/notification/NotificationIntentService.java +++ b/app/src/main/java/name/gumartinm/weather/information/notification/NotificationIntentService.java @@ -107,8 +107,7 @@ public class NotificationIntentService extends IntentService { final String urlAPI = this.getResources().getString(R.string.uri_api_weather_today); final String url = weatherService.createURIAPICurrent(urlAPI, APIVersion, weatherLocation.getLatitude(), weatherLocation.getLongitude()); - final String urlWithoutCache = url.concat("&time=" + System.currentTimeMillis()); - final String jsonData = HTTPClient.retrieveDataAsString(new URL(urlWithoutCache)); + final String jsonData = HTTPClient.retrieveDataAsString(new URL(url)); return weatherService.retrieveCurrentFromJPOS(jsonData); } diff --git a/app/src/main/java/name/gumartinm/weather/information/widget/WidgetIntentService.java b/app/src/main/java/name/gumartinm/weather/information/widget/WidgetIntentService.java index 761fdf5..6eaa678 100644 --- a/app/src/main/java/name/gumartinm/weather/information/widget/WidgetIntentService.java +++ b/app/src/main/java/name/gumartinm/weather/information/widget/WidgetIntentService.java @@ -178,8 +178,7 @@ public class WidgetIntentService extends IntentService { final String urlAPI = this.getResources().getString(R.string.uri_api_weather_today); final String url = weatherService.createURIAPICurrent(urlAPI, APIVersion, weatherLocation.getLatitude(), weatherLocation.getLongitude()); - final String urlWithoutCache = url.concat("&time=" + System.currentTimeMillis()); - final String jsonData = HTTPClient.retrieveDataAsString(new URL(urlWithoutCache)); + final String jsonData = HTTPClient.retrieveDataAsString(new URL(url)); return weatherService.retrieveCurrentFromJPOS(jsonData); } -- 2.1.4