<?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 Unable to use Token and Referer to query features table in android ArcGIS SDK in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/unable-to-use-token-and-referer-to-query-features/m-p/466531#M3161</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below is the code I'm using for setting user credentials on ServiceFeatureTable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;credential = UserCredential.createFromToken(gisToken, referer);&lt;/P&gt;&lt;P&gt;ServiceFeatureTable featureTablePolygons = new ServiceFeatureTable(polygonUrl);&lt;BR /&gt; featureTablePolygons.setCredential(credential);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;final ListenableFuture&amp;lt;FeatureQueryResult&amp;gt; queryResultPolygons = featureTablePolygons.queryFeaturesAsync(query);&lt;BR /&gt; queryResultPolygons.addDoneListener(() -&amp;gt; {&lt;BR /&gt; try {&lt;BR /&gt; FeatureCollection featureCollection = new FeatureCollection();&lt;BR /&gt; FeatureQueryResult result = queryResultPolygons.get();&lt;BR /&gt; FeatureCollectionTable featureCollectionTable = new FeatureCollectionTable(result);&lt;BR /&gt; featureCollection.getTables().add(featureCollectionTable);&lt;BR /&gt; FeatureCollectionLayer featureCollectionLayer = new FeatureCollectionLayer(featureCollection);&lt;BR /&gt; mMapView.getMap().getOperationalLayers().add(featureCollectionLayer);&lt;/P&gt;&lt;P&gt;if (result.iterator().hasNext()) {&lt;BR /&gt; Feature feature = result.iterator().next();&lt;BR /&gt; Envelope envelope = feature.getGeometry().getExtent();&lt;BR /&gt; mMapView.setViewpointGeometryAsync(envelope);&lt;BR /&gt; } else {&lt;BR /&gt; // Toast.makeText(mContext, "No polygons found for " + queryString, Toast.LENGTH_SHORT).show();&lt;BR /&gt; }&lt;BR /&gt; } catch (InterruptedException | ExecutionException e) {&lt;BR /&gt; Log.e(TAG, "Error in FeatureQueryResult: " + e.getMessage());&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this is not working. If I'm using AuthenticationManager then it's working fine but I don't want to use username and password in my code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Nov 2018 06:59:30 GMT</pubDate>
    <dc:creator>manojkumar9</dc:creator>
    <dc:date>2018-11-12T06:59:30Z</dc:date>
    <item>
      <title>Unable to use Token and Referer to query features table in android ArcGIS SDK</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/unable-to-use-token-and-referer-to-query-features/m-p/466531#M3161</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Below is the code I'm using for setting user credentials on ServiceFeatureTable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;credential = UserCredential.createFromToken(gisToken, referer);&lt;/P&gt;&lt;P&gt;ServiceFeatureTable featureTablePolygons = new ServiceFeatureTable(polygonUrl);&lt;BR /&gt; featureTablePolygons.setCredential(credential);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;final ListenableFuture&amp;lt;FeatureQueryResult&amp;gt; queryResultPolygons = featureTablePolygons.queryFeaturesAsync(query);&lt;BR /&gt; queryResultPolygons.addDoneListener(() -&amp;gt; {&lt;BR /&gt; try {&lt;BR /&gt; FeatureCollection featureCollection = new FeatureCollection();&lt;BR /&gt; FeatureQueryResult result = queryResultPolygons.get();&lt;BR /&gt; FeatureCollectionTable featureCollectionTable = new FeatureCollectionTable(result);&lt;BR /&gt; featureCollection.getTables().add(featureCollectionTable);&lt;BR /&gt; FeatureCollectionLayer featureCollectionLayer = new FeatureCollectionLayer(featureCollection);&lt;BR /&gt; mMapView.getMap().getOperationalLayers().add(featureCollectionLayer);&lt;/P&gt;&lt;P&gt;if (result.iterator().hasNext()) {&lt;BR /&gt; Feature feature = result.iterator().next();&lt;BR /&gt; Envelope envelope = feature.getGeometry().getExtent();&lt;BR /&gt; mMapView.setViewpointGeometryAsync(envelope);&lt;BR /&gt; } else {&lt;BR /&gt; // Toast.makeText(mContext, "No polygons found for " + queryString, Toast.LENGTH_SHORT).show();&lt;BR /&gt; }&lt;BR /&gt; } catch (InterruptedException | ExecutionException e) {&lt;BR /&gt; Log.e(TAG, "Error in FeatureQueryResult: " + e.getMessage());&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this is not working. If I'm using AuthenticationManager then it's working fine but I don't want to use username and password in my code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Nov 2018 06:59:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/unable-to-use-token-and-referer-to-query-features/m-p/466531#M3161</guid>
      <dc:creator>manojkumar9</dc:creator>
      <dc:date>2018-11-12T06:59:30Z</dc:date>
    </item>
  </channel>
</rss>

