WeatherInformation: http client agent string as resource
authorGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 16 Nov 2014 15:29:32 +0000 (16:29 +0100)
committerGustavo Martin Morcuende <gu.martinm@gmail.com>
Sun, 16 Nov 2014 15:29:32 +0000 (16:29 +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
app/src/main/res/values/strings.xml

index b80cc67..5f7f3ff 100644 (file)
@@ -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());
index 5e43de2..701e5e2 100644 (file)
@@ -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());
index 1ed1431..932b49c 100644 (file)
@@ -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 {
index c97740e..5311017 100644 (file)
@@ -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);
index 898ec06..b9893b8 100644 (file)
@@ -14,7 +14,7 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
-<resources xmlns:android="http://schemas.android.com/apk/res/android">
+<resources>
 
     <string name="app_name">Weather Information</string>
     <string name="icon_weather_description">Icon weather</string>
     <string name="openweahtermap_url">http://openweathermap.org/</string>
     <string name="title_activity_about">About</string>
     <string name="action_settings">Settings</string>
+    <string name="http_client_agent">Android WeatherInformation Agent</string>
 
 </resources>