Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

User-Agent for osmdroid

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 !

like image 900
Jbell Avatar asked Apr 01 '17 02:04

Jbell


1 Answers

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.

like image 96
spy Avatar answered Oct 10 '22 12:10

spy