diff --git a/app/build.gradle b/app/build.gradle
index f39f9a21..c48e284e 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -38,7 +38,7 @@ android {
buildConfigField "String[]", "DEFAULT_API_KEYS", "{null}"
}
- buildConfigField "String", "BASE_URL", "\"https://api.openweathermap.org/data/2.5/\""
+ buildConfigField "String", "BASE_URL", "\"https://api.openweathermap.org/data/3.0/\""
javaCompileOptions {
annotationProcessorOptions {
diff --git a/app/src/main/java/org/secuso/privacyfriendlyweather/activities/ForecastCityActivity.java b/app/src/main/java/org/secuso/privacyfriendlyweather/activities/ForecastCityActivity.java
index dc5d09bd..3cb16832 100644
--- a/app/src/main/java/org/secuso/privacyfriendlyweather/activities/ForecastCityActivity.java
+++ b/app/src/main/java/org/secuso/privacyfriendlyweather/activities/ForecastCityActivity.java
@@ -1,7 +1,9 @@
package org.secuso.privacyfriendlyweather.activities;
+import android.app.AlertDialog;
import android.content.Intent;
import android.os.Bundle;
+import android.preference.PreferenceManager;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
@@ -19,6 +21,7 @@
import org.secuso.privacyfriendlyweather.database.data.CurrentWeatherData;
import org.secuso.privacyfriendlyweather.database.data.Forecast;
import org.secuso.privacyfriendlyweather.database.data.WeekForecast;
+import org.secuso.privacyfriendlyweather.preferences.AppPreferencesManager;
import org.secuso.privacyfriendlyweather.ui.updater.IUpdateableCityUI;
import org.secuso.privacyfriendlyweather.ui.updater.ViewUpdater;
import org.secuso.privacyfriendlyweather.ui.viewPager.WeatherPagerAdapter;
@@ -27,6 +30,7 @@
public class ForecastCityActivity extends BaseActivity implements IUpdateableCityUI {
private WeatherPagerAdapter pagerAdapter;
+ private AppPreferencesManager appPreferencesManager;
private MenuItem refreshActionButton;
private MenuItem rainviewerButton;
@@ -73,7 +77,6 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_forecast_city);
overridePendingTransition(0, 0);
-
//cityId = getIntent().getIntExtra("cityId", -1); //done in onResume
initResources();
@@ -113,6 +116,18 @@ public void onPageScrollStateChanged(int state) {}
}
}
+ @Override
+ protected void onPostCreate(Bundle savedInstanceState) {
+ super.onPostCreate(savedInstanceState);
+
+ if (appPreferencesManager.getOWMApiKey(this) == null) {
+ new AlertDialog.Builder(this).setTitle("")
+ .setMessage("Get your own API-Key yo")
+ .setNeutralButton(android.R.string.ok, null)
+ .show();
+ }
+ }
+
public void updatePageTitle() {
if (getSupportActionBar() != null && pagerAdapter.getCount() > 0) {
getSupportActionBar().setTitle(pagerAdapter.getPageTitleForActionBar(viewPager.getCurrentItem()));
@@ -129,6 +144,7 @@ private void initResources() {
viewPager = findViewById(R.id.viewPager);
pagerAdapter = new WeatherPagerAdapter(this, getSupportFragmentManager());
noCityText = findViewById(R.id.noCitySelectedText);
+ appPreferencesManager = new AppPreferencesManager(PreferenceManager.getDefaultSharedPreferences(this));
}
@Override
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index 444f69a9..d1b619a8 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -204,4 +204,6 @@
Die Wetter-App ermöglicht Backups mit unserer Privacy Friendly Backup-App. Um diese Funktionalität zu aktivieren, wird die Berechtigung zum Verbinden mit Diensten benötigt.
Wetterdaten zur Verfügung gestellt von:
"Das OpenWeatherMap Logo ist lizensiert unter\nCreative Commons BY-SA."
+ App Deprecation and API changes
+ Am 1. Juni 2024 deaktiviert Open Weather seine alte API, daher sind die alten API-Schlüssel nicht mehr verwendbar.
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index c39053f0..9704b963 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -203,4 +203,6 @@
L\'app meteo abilita i backup con la nostra app Privacy Friendly Backup. Per abilitare questa funzionalità, è necessario il permesso di legarsi ai servizi.
Dati meteo forniti da:
"Il logo di OpenWeatherMap è concesso in licenza sotto\nla licenza Creative Commons BY-SA."
+ Deprecazione dell\'app e modifiche all\'API
+ Dal 1° giugno 2024 Open Weather disattiva la sua vecchia API, pertanto le vecchie chiavi API non sono più utilizzabili.
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index 418984f5..d388c7e4 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -257,5 +257,7 @@
The weather app enables backups with our Privacy Friendly Backup app. To enable this functionality, the permission to bind with services is needed.
Weather data provided by:
"OpenWeatherMap logo is licensed under\nCreative Commons BY-SA license."
+ アプリの非推奨と API の変更
+ 2024 年 6 月 1 日に、Open Weather は古い API を非アクティブ化するため、古い API キーは使用できなくなります。
diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml
index 35ea47b3..0ab88d80 100644
--- a/app/src/main/res/values-pt/strings.xml
+++ b/app/src/main/res/values-pt/strings.xml
@@ -203,4 +203,6 @@
A aplicação meteorológica permite cópias de segurança com a nossa aplicação Privacy Friendly Backup. Para activar esta funcionalidade, é necessária a permissão de ligação com serviços.
Dados meteorológicos fornecidos por:
"O logótipo OpenWeatherMap está licenciado sob\nCreative Commons BY-SA licença."
+ Descontinuação de aplicativos e alterações de API
+ Em 1º de junho de 2024, o Open Weather desativa sua API antiga, portanto, as chaves da API antigas não podem mais ser usadas.
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index ad904020..b5465542 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -174,6 +174,14 @@
Close
Add
+ App Deprecation and API changes
+
+ On 1st June, 2024 Open Weather deactivates its old API, therefore the old api keys are not usable anymore.
+ As the Privacy Friendly Weather App is deprecated, we won\'t adjust to any api changes and the app won\'t function as expected.
+
+ If you want to continue using this app, get your own api key by following the OpenWeather instruction.
+ After obtaining your api key, set it in the settings.
+
Clear Sky