AnsweredAssumed Answered

Android Offline Tiles, User Credentials and Tokens

Question asked by billmyers1 on Nov 5, 2015
Latest reply on Jan 4, 2017 by ANohe-esristaff

I'm developing an app using the ArcGIS Runtime SDK for Android.  I'm accessing tiled basemaps from using the following code which works fine.


UserCredentials creds = new UserCredentials();

creds.setUserToken("token", "referer");

String mapUrlUsaTopo = "";

mBasemapLayer = new ArcGISTiledMapServiceLayer(mapUrlUsaTopo, creds);


But... when I attempt to download the map tiles for offline use I get the following error: Message: Unable to generate token. Details: 'username' must be specified., 'password' must be specified.


Here's the download code:

String tileUrlUsaTopo = "";

final ExportTileCacheTask exportTileCacheTask = new ExportTileCacheTask(tileUrlUsaTopo, creds);


Is the only option hard coding the username and password?