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 !
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.
来源:https://stackoverflow.com/questions/43152016/user-agent-for-osmdroid