User-Agent for osmdroid
Asked Answered
M

1

14

I tried to put the user agent (cf https://github.com/osmdroid/osmdroid/wiki/Important-notes-on-using-osmdroid-in-your-app), but when I put the line OpenStreetMapTileProviderConstants.setUserAgentValue(BuildConfig.APPLICATION_ID); Android studio is telling me that setUserAgentValue is depreciated.

What can I do to solve that ? For now when I run the app I have a grid with no map.

Thanks you very much in advance !

Mcroberts answered 1/4, 2017 at 2:4 Comment(1)
A deprecated method doesn't indicate it doesn't work. It just means that method may go away in a future version of the library. Does the first question of the FAQ help? github.com/osmdroid/osmdroid/wiki/FAQKrimmer
A
13

It's deprecated because it's been moved to another location which consolidates all configuration settings for osmdroid. Try the following

Configuration.getInstance().setUserAgentValue(...)

The older method was rewritten to wire it into the new configuration construct.

Aurar answered 1/4, 2017 at 17:10 Comment(1)
Thanks, this solve the problem with the depreciated class ! But the problem is that I still have just a grid and no map. (In fact my problem is the same of this subject : https://mcmap.net/q/831043/-no-map-shown-in-osmdroid , that why I was trying to set the user agent) Thanks in advanceMcroberts

© 2022 - 2024 — McMap. All rights reserved.