From 83b3b8a48dacddf5e81d2d47fd93ad88457db1ab Mon Sep 17 00:00:00 2001 From: Daniele Date: Mon, 22 Nov 2021 08:55:35 +0100 Subject: [PATCH] Set OSMDroid UserAgent --- app/release/output-metadata.json | 4 ++-- .../activity/detail/GeofavoriteDetailActivity.java | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json index 948c000..a8de7ff 100644 --- a/app/release/output-metadata.json +++ b/app/release/output-metadata.json @@ -10,8 +10,8 @@ { "type": "SINGLE", "filters": [], - "versionCode": 3, - "versionName": "0.3.1", + "versionCode": 5, + "versionName": "0.3.3", "outputFile": "app-release.apk" } ] diff --git a/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/detail/GeofavoriteDetailActivity.java b/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/detail/GeofavoriteDetailActivity.java index 6a712f2..272c27c 100644 --- a/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/detail/GeofavoriteDetailActivity.java +++ b/app/src/main/java/it/danieleverducci/nextcloudmaps/activity/detail/GeofavoriteDetailActivity.java @@ -43,6 +43,7 @@ import androidx.preference.PreferenceManager; import org.osmdroid.api.IMapController; import org.osmdroid.config.Configuration; +import org.osmdroid.config.IConfigurationProvider; import org.osmdroid.util.GeoPoint; import org.osmdroid.views.CustomZoomButtonsController; import org.osmdroid.views.overlay.Marker; @@ -53,6 +54,7 @@ import java.util.Date; import java.util.HashSet; import java.util.List; +import it.danieleverducci.nextcloudmaps.BuildConfig; import it.danieleverducci.nextcloudmaps.R; import it.danieleverducci.nextcloudmaps.activity.main.MainActivity; import it.danieleverducci.nextcloudmaps.activity.main.MainActivityViewModel; @@ -81,8 +83,10 @@ public class GeofavoriteDetailActivity extends AppCompatActivity implements Loca super.onCreate(savedInstanceState); // OSMDroid config - Configuration.getInstance().load(getApplicationContext(), + IConfigurationProvider osmdroidConfig = Configuration.getInstance(); + osmdroidConfig.load(getApplicationContext(), PreferenceManager.getDefaultSharedPreferences(getApplicationContext())); + osmdroidConfig.setUserAgentValue(BuildConfig.APPLICATION_ID); mViewHolder = new ViewHolder(getLayoutInflater()); setContentView(mViewHolder.getRootView());