<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Android Offline Tiles, User Credentials and Tokens in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-offline-tiles-user-credentials-and-tokens/m-p/487012#M3347</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm developing an app using the ArcGIS Runtime SDK for Android.&amp;nbsp; I'm accessing tiled basemaps from arcgis.com using the following code which works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UserCredentials &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;creds &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;UserCredentials();&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;creds&lt;/SPAN&gt;.setUserToken(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"token"&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"referer"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;String &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapUrlUsaTopo &lt;/SPAN&gt;= &lt;SPAN style="color: #008000; font-weight: bold;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fservices.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FUSA_Topo_Maps%2FMapServer" rel="nofollow" target="_blank"&gt;https://services.arcgisonline.com/arcgis/rest/services/USA_Topo_Maps/MapServer&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBasemapLayer &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;ArcGISTiledMapServiceLayer(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapUrlUsaTopo&lt;/SPAN&gt;, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;creds&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But... when I attempt to download the map tiles for offline use I get the following error: &lt;STRONG&gt;com.esri.core.io.EsriSecurityException: Message: Unable to generate token. Details: 'username' must be specified., 'password' must be specified.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the download code:&lt;/P&gt;&lt;P&gt;String &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;tileUrlUsaTopo &lt;/SPAN&gt;= &lt;SPAN style="color: #008000; font-weight: bold;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Ftiledbasemaps.arcgis.com%2Farcgis%2Frest%2Fservices%2FUSA_Topo_Maps%2FMapServer" rel="nofollow" target="_blank"&gt;https://tiledbasemaps.arcgis.com/arcgis/rest/services/USA_Topo_Maps/MapServer&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;final &lt;/SPAN&gt;ExportTileCacheTask exportTileCacheTask = &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;ExportTileCacheTask(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;tileUrlUsaTopo&lt;/SPAN&gt;, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;creds&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the only option hard coding the username and password?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Nov 2015 01:11:59 GMT</pubDate>
    <dc:creator>BillMyers1</dc:creator>
    <dc:date>2015-11-06T01:11:59Z</dc:date>
    <item>
      <title>Android Offline Tiles, User Credentials and Tokens</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-offline-tiles-user-credentials-and-tokens/m-p/487012#M3347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm developing an app using the ArcGIS Runtime SDK for Android.&amp;nbsp; I'm accessing tiled basemaps from arcgis.com using the following code which works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UserCredentials &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;creds &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;UserCredentials();&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;creds&lt;/SPAN&gt;.setUserToken(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"token"&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"referer"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;String &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapUrlUsaTopo &lt;/SPAN&gt;= &lt;SPAN style="color: #008000; font-weight: bold;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fservices.arcgisonline.com%2Farcgis%2Frest%2Fservices%2FUSA_Topo_Maps%2FMapServer" rel="nofollow" target="_blank"&gt;https://services.arcgisonline.com/arcgis/rest/services/USA_Topo_Maps/MapServer&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mBasemapLayer &lt;/SPAN&gt;= &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;ArcGISTiledMapServiceLayer(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mapUrlUsaTopo&lt;/SPAN&gt;, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;creds&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But... when I attempt to download the map tiles for offline use I get the following error: &lt;STRONG&gt;com.esri.core.io.EsriSecurityException: Message: Unable to generate token. Details: 'username' must be specified., 'password' must be specified.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the download code:&lt;/P&gt;&lt;P&gt;String &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;tileUrlUsaTopo &lt;/SPAN&gt;= &lt;SPAN style="color: #008000; font-weight: bold;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Ftiledbasemaps.arcgis.com%2Farcgis%2Frest%2Fservices%2FUSA_Topo_Maps%2FMapServer" rel="nofollow" target="_blank"&gt;https://tiledbasemaps.arcgis.com/arcgis/rest/services/USA_Topo_Maps/MapServer&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;final &lt;/SPAN&gt;ExportTileCacheTask exportTileCacheTask = &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;ExportTileCacheTask(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;tileUrlUsaTopo&lt;/SPAN&gt;, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;creds&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the only option hard coding the username and password?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Nov 2015 01:11:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-offline-tiles-user-credentials-and-tokens/m-p/487012#M3347</guid>
      <dc:creator>BillMyers1</dc:creator>
      <dc:date>2015-11-06T01:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Android Offline Tiles and UserCredentials</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-offline-tiles-user-credentials-and-tokens/m-p/487013#M3348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It would be great if the Esri Android Dev team would respond.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 00:29:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-offline-tiles-user-credentials-and-tokens/m-p/487013#M3348</guid>
      <dc:creator>BillMyers1</dc:creator>
      <dc:date>2015-11-10T00:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Android Offline Tiles, User Credentials and Tokens</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-offline-tiles-user-credentials-and-tokens/m-p/487014#M3349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Andrew from Esri support was very helpful.&amp;nbsp; To do "application" authentication (without a user name and password) using your app id and secret key you need something like the code below.&amp;nbsp; However, there is a bug (BUG-000092420) in the android sdk and code below does not work at the present time.&amp;nbsp; I'm being told that the fix may make in into the Quartz final release.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;private class &lt;/SPAN&gt;AppLoginTask &lt;SPAN style="color: #000080; font-weight: bold;"&gt;extends &lt;/SPAN&gt;AsyncTask&amp;lt;Void, Void, Void&amp;gt; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808000;"&gt;@Override&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808000;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;protected &lt;/SPAN&gt;Void doInBackground(Void... params) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; Log.&lt;SPAN style="font-style: italic;"&gt;d&lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"MyApp"&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"AppLoginTask"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Portal p = &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;Portal(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fwww.arcgis.com" rel="nofollow" target="_blank"&gt;https://www.arcgis.com&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;null&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;try &lt;/SPAN&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp; p.doOAuthAppAuthenticate(&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;APP_SECRET&lt;/SPAN&gt;, &lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;APP_ID&lt;/SPAN&gt;, &lt;SPAN style="color: #000080; font-weight: bold;"&gt;new &lt;/SPAN&gt;CallbackListener&amp;lt;Portal&amp;gt;() {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808000;"&gt;@Override&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808000;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onCallback(Portal portal) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; Log.&lt;SPAN style="font-style: italic;"&gt;d&lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"MyApp"&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"login callback"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;//mCreds = new UserCredentials();&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #660e7a; font-weight: bold;"&gt;mCreds &lt;/SPAN&gt;= portal.getCredentials();&lt;/P&gt;&lt;P&gt;&amp;nbsp; setMapDataMode(MapDataMode.&lt;SPAN style="color: #660e7a; font-weight: bold; font-style: italic;"&gt;ONLINE&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808000;"&gt;@Override&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808000;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;public void &lt;/SPAN&gt;onError(Throwable throwable) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; Log.&lt;SPAN style="font-style: italic;"&gt;e&lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"MyApp"&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"login error"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; });&lt;/P&gt;&lt;P&gt;&amp;nbsp; } &lt;SPAN style="color: #000080; font-weight: bold;"&gt;catch &lt;/SPAN&gt;(Exception e) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; Log.&lt;SPAN style="font-style: italic;"&gt;d&lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"MyApp"&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"login exception"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp; e.printStackTrace();&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #000080; font-weight: bold;"&gt;return null&lt;/SPAN&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808000;"&gt;@Override&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808000;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;protected void &lt;/SPAN&gt;onPostExecute(Void results) {&lt;/P&gt;&lt;P&gt;&amp;nbsp; Log.&lt;SPAN style="font-style: italic;"&gt;d&lt;/SPAN&gt;(&lt;SPAN style="color: #008000; font-weight: bold;"&gt;"MyApp"&lt;/SPAN&gt;, &lt;SPAN style="color: #008000; font-weight: bold;"&gt;"login post execute"&lt;/SPAN&gt;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #808080; font-style: italic;"&gt;//setMapDataMode(MapDataMode.ONLINE);&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #808080; font-style: italic;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Dec 2015 00:34:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-offline-tiles-user-credentials-and-tokens/m-p/487014#M3349</guid>
      <dc:creator>BillMyers1</dc:creator>
      <dc:date>2015-12-02T00:34:13Z</dc:date>
    </item>
    <item>
      <title>Re: Android Offline Tiles, User Credentials and Tokens</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-offline-tiles-user-credentials-and-tokens/m-p/487015#M3350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Does anyone know if this works now in version 100.0.0?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Dec 2016 15:29:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-offline-tiles-user-credentials-and-tokens/m-p/487015#M3350</guid>
      <dc:creator>BillMyers1</dc:creator>
      <dc:date>2016-12-16T15:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Android Offline Tiles, User Credentials and Tokens</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-offline-tiles-user-credentials-and-tokens/m-p/487016#M3351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lite level licensing worked for me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/android/latest/guide/license-your-app.htm" title="https://developers.arcgis.com/android/latest/guide/license-your-app.htm"&gt;License your app—ArcGIS Runtime SDK for Android | ArcGIS for Developers&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a specific level of licensing that you are looking to use?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jan 2017 15:02:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-offline-tiles-user-credentials-and-tokens/m-p/487016#M3351</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2017-01-04T15:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: Android Offline Tiles, User Credentials and Tokens</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-offline-tiles-user-credentials-and-tokens/m-p/487017#M3352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I have the same problem with Runtime 100.6 on Android. I didn't found any bug fix in 100.7 anouncement&amp;nbsp;&lt;A class="link-titled" href="https://www.esri.com/arcgis-blog/products/developers/announcements/welcome-to-arcgis-runtime-100-7/" title="https://www.esri.com/arcgis-blog/products/developers/announcements/welcome-to-arcgis-runtime-100-7/"&gt;Announcing ArcGIS Runtime 100.7&lt;/A&gt;&amp;nbsp;. Was it fixed ? Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Feb 2020 22:18:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/android-offline-tiles-user-credentials-and-tokens/m-p/487017#M3352</guid>
      <dc:creator>ClémentLaskar</dc:creator>
      <dc:date>2020-02-25T22:18:03Z</dc:date>
    </item>
  </channel>
</rss>

