From 6afd2009800c64719b5685680029b7ce767bba58 Mon Sep 17 00:00:00 2001 From: Gustavo Martin Morcuende Date: Sun, 16 Nov 2014 16:29:32 +0100 Subject: [PATCH] WeatherInformation: http client agent string as resource --- .../weather/information/fragment/current/CurrentFragment.java | 2 +- .../weather/information/fragment/overview/OverviewFragment.java | 2 +- .../weather/information/notification/NotificationIntentService.java | 2 +- .../name/gumartinm/weather/information/widget/WidgetIntentService.java | 3 +-- Android/WeatherInformation/app/src/main/res/values/strings.xml | 3 ++- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Android/WeatherInformation/app/src/main/java/name/gumartinm/weather/information/fragment/current/CurrentFragment.java b/Android/WeatherInformation/app/src/main/java/name/gumartinm/weather/information/fragment/current/CurrentFragment.java index b80cc67..5f7f3ff 100644 --- a/Android/WeatherInformation/app/src/main/java/name/gumartinm/weather/information/fragment/current/CurrentFragment.java +++ b/Android/WeatherInformation/app/src/main/java/name/gumartinm/weather/information/fragment/current/CurrentFragment.java @@ -183,7 +183,7 @@ public class CurrentFragment extends Fragment { this.getActivity().findViewById(R.id.weather_current_error_message).setVisibility(View.GONE); final CurrentTask task = new CurrentTask( this.getActivity().getApplicationContext(), - new CustomHTTPClient(AndroidHttpClient.newInstance("Android 4.3 WeatherInformation Agent")), + new CustomHTTPClient(AndroidHttpClient.newInstance(this.getString(R.string.http_client_agent))), new ServiceCurrentParser(new JPOSCurrentParser())); task.execute(weatherLocation.getLatitude(), weatherLocation.getLongitude()); diff --git a/Android/WeatherInformation/app/src/main/java/name/gumartinm/weather/information/fragment/overview/OverviewFragment.java b/Android/WeatherInformation/app/src/main/java/name/gumartinm/weather/information/fragment/overview/OverviewFragment.java index 5e43de2..701e5e2 100644 --- a/Android/WeatherInformation/app/src/main/java/name/gumartinm/weather/information/fragment/overview/OverviewFragment.java +++ b/Android/WeatherInformation/app/src/main/java/name/gumartinm/weather/information/fragment/overview/OverviewFragment.java @@ -161,7 +161,7 @@ public class OverviewFragment extends ListFragment { this.setListShownNoAnimation(false); final OverviewTask task = new OverviewTask( this.getActivity().getApplicationContext(), - new CustomHTTPClient(AndroidHttpClient.newInstance("Android 4.3 WeatherInformation Agent")), + new CustomHTTPClient(AndroidHttpClient.newInstance(this.getString(R.string.http_client_agent))), new ServiceForecastParser(new JPOSForecastParser())); task.execute(weatherLocation.getLatitude(), weatherLocation.getLongitude()); diff --git a/Android/WeatherInformation/app/src/main/java/name/gumartinm/weather/information/notification/NotificationIntentService.java b/Android/WeatherInformation/app/src/main/java/name/gumartinm/weather/information/notification/NotificationIntentService.java index 1ed1431..932b49c 100644 --- a/Android/WeatherInformation/app/src/main/java/name/gumartinm/weather/information/notification/NotificationIntentService.java +++ b/Android/WeatherInformation/app/src/main/java/name/gumartinm/weather/information/notification/NotificationIntentService.java @@ -68,7 +68,7 @@ public class NotificationIntentService extends IntentService { if (weatherLocation != null) { final ServiceCurrentParser weatherService = new ServiceCurrentParser(new JPOSCurrentParser()); final CustomHTTPClient HTTPClient = new CustomHTTPClient( - AndroidHttpClient.newInstance("Android 4.3 WeatherInformation Agent")); + AndroidHttpClient.newInstance(this.getString(R.string.http_client_agent))); Current current = null; try { diff --git a/Android/WeatherInformation/app/src/main/java/name/gumartinm/weather/information/widget/WidgetIntentService.java b/Android/WeatherInformation/app/src/main/java/name/gumartinm/weather/information/widget/WidgetIntentService.java index c97740e..5311017 100644 --- a/Android/WeatherInformation/app/src/main/java/name/gumartinm/weather/information/widget/WidgetIntentService.java +++ b/Android/WeatherInformation/app/src/main/java/name/gumartinm/weather/information/widget/WidgetIntentService.java @@ -24,7 +24,6 @@ import name.gumartinm.weather.information.parser.JPOSCurrentParser; import name.gumartinm.weather.information.service.IconsList; import name.gumartinm.weather.information.service.PermanentStorage; import name.gumartinm.weather.information.service.ServiceCurrentParser; -import name.gumartinm.weather.information.widget.WidgetConfigure; import org.apache.http.client.ClientProtocolException; @@ -109,7 +108,7 @@ public class WidgetIntentService extends IntentService { final ServiceCurrentParser weatherService = new ServiceCurrentParser(new JPOSCurrentParser()); final CustomHTTPClient HTTPClient = new CustomHTTPClient( - AndroidHttpClient.newInstance("Android 4.3 WeatherInformation Agent")); + AndroidHttpClient.newInstance(this.getString(R.string.http_client_agent))); try { return this.getRemoteCurrentThrowable(weatherLocation, HTTPClient, weatherService); diff --git a/Android/WeatherInformation/app/src/main/res/values/strings.xml b/Android/WeatherInformation/app/src/main/res/values/strings.xml index 898ec06..b9893b8 100644 --- a/Android/WeatherInformation/app/src/main/res/values/strings.xml +++ b/Android/WeatherInformation/app/src/main/res/values/strings.xml @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. --> - + Weather Information Icon weather @@ -121,5 +121,6 @@ http://openweathermap.org/ About Settings + Android WeatherInformation Agent -- 2.1.4