Do not pass through the OpenWeatherMap proxy cache
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Sat, 22 Nov 2014 14:08:36 +0000 (15:08 +0100)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Sat, 22 Nov 2014 14:08:36 +0000 (15:08 +0100)
app/src/main/java/name/gumartinm/weather/information/fragment/current/CurrentFragment.java
app/src/main/java/name/gumartinm/weather/information/fragment/overview/OverviewFragment.java
app/src/main/java/name/gumartinm/weather/information/notification/NotificationIntentService.java
app/src/main/java/name/gumartinm/weather/information/widget/WidgetIntentService.java

index b0791a9..0d04dc4 100644 (file)
@@ -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);
         }
index e3c6418..e102f80 100644 (file)
@@ -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);
         }
index 0c52886..64502dd 100644 (file)
@@ -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);
     }
index 761fdf5..6eaa678 100644 (file)
@@ -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);
        }