From 15f6364c01b061e33e91c82c3bcb8f6214a4a6d1 Mon Sep 17 00:00:00 2001 From: "gu.martinm@gmail.com" Date: Mon, 5 May 2014 06:12:25 +0200 Subject: [PATCH] WeatherInformation: wake up service with alarm --- Android/WeatherInformation/AndroidManifest.xml | 15 ++- Android/WeatherInformation/res/values/arrays.xml | 14 +++ Android/WeatherInformation/res/values/strings.xml | 4 +- .../res/xml/weather_preferences.xml | 12 +- .../exampletdd/WeatherInformationActivity.java | 123 -------------------- .../exampletdd/WeatherInformationBatch.java | 74 +++--------- .../exampletdd/WeatherInformationBootReceiver.java | 39 +++++++ .../exampletdd/WeatherInformationMapActivity.java | 10 -- .../de/example/exampletdd/WeatherTabsActivity.java | 79 +++++++++++-- .../exampletdd/activityinterface/GetWeather.java | 10 -- .../WeatherInformationCurrentDataFragment.java | 34 +++--- .../WeatherInformationOverviewFragment.java | 127 +++++++++++---------- .../WeatherInformationPreferencesFragment.java | 41 +++++-- .../exampletdd/httpclient/CustomHTTPClient.java | 10 +- .../de/example/exampletdd/model/GeocodingData.java | 40 +++++++ 15 files changed, 319 insertions(+), 313 deletions(-) delete mode 100644 Android/WeatherInformation/src/de/example/exampletdd/WeatherInformationActivity.java create mode 100644 Android/WeatherInformation/src/de/example/exampletdd/WeatherInformationBootReceiver.java delete mode 100644 Android/WeatherInformation/src/de/example/exampletdd/activityinterface/GetWeather.java diff --git a/Android/WeatherInformation/AndroidManifest.xml b/Android/WeatherInformation/AndroidManifest.xml index 9b37dd1..134f903 100644 --- a/Android/WeatherInformation/AndroidManifest.xml +++ b/Android/WeatherInformation/AndroidManifest.xml @@ -25,10 +25,7 @@ - - - - + + + + + + + + android:enabled="true" /> 10-Day Forecast 14-Day Forecast + + 60 + 120 + 300 + 600 + 900 + + + 1 minute + 2 minutes + 5 minutes + 10 minutes + 15 minutes + diff --git a/Android/WeatherInformation/res/values/strings.xml b/Android/WeatherInformation/res/values/strings.xml index 4beeadf..46edf0e 100644 --- a/Android/WeatherInformation/res/values/strings.xml +++ b/Android/WeatherInformation/res/values/strings.xml @@ -39,8 +39,8 @@ Fahrenheit Celsius Unit of measurement for temperature - weather_preferences_language - Language + weather_preferences_update_time_rate + Update Time Rate weather_preferences_day_forecast Forecast days number city not found diff --git a/Android/WeatherInformation/res/xml/weather_preferences.xml b/Android/WeatherInformation/res/xml/weather_preferences.xml index 3490cb6..8ee76dc 100644 --- a/Android/WeatherInformation/res/xml/weather_preferences.xml +++ b/Android/WeatherInformation/res/xml/weather_preferences.xml @@ -10,14 +10,14 @@ android:persistent="true" android:defaultValue="Celsius" /> + android:summary="1 minute"/> >> 32)); + temp = Double.doubleToLongBits(this.longitude); + result = (prime * result) + (int) (temp ^ (temp >>> 32)); + return result; + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (this.getClass() != obj.getClass()) + return false; + final GeocodingData other = (GeocodingData) obj; + if (this.city == null) { + if (other.city != null) + return false; + } else if (!this.city.equals(other.city)) + return false; + if (this.country == null) { + if (other.country != null) + return false; + } else if (!this.country.equals(other.country)) + return false; + if (Double.doubleToLongBits(this.latitude) != Double.doubleToLongBits(other.latitude)) + return false; + if (Double.doubleToLongBits(this.longitude) != Double.doubleToLongBits(other.longitude)) + return false; + return true; + } } -- 2.1.4