13

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 !

Jbell
  • 313
  • 2
  • 7
  • 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? https://github.com/osmdroid/osmdroid/wiki/FAQ – loeschg Apr 01 '17 at 03:49

1 Answers1

12

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.

Alexander Pacha
  • 9,187
  • 3
  • 68
  • 108
spy
  • 3,199
  • 1
  • 18
  • 26
  • 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 : http://stackoverflow.com/questions/43020570/no-map-shown-in-osmdroid , that why I was trying to set the user agent) Thanks in advance – Jbell Apr 01 '17 at 18:26