<?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 Re: How to get the fields in each layer of a DynamicMapServiceLayer? in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-get-the-fields-in-each-layer-of-a/m-p/234034#M1503</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, I'll implement that and return here with the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Jan 2016 20:06:51 GMT</pubDate>
    <dc:creator>FrancisGagne</dc:creator>
    <dc:date>2016-01-27T20:06:51Z</dc:date>
    <item>
      <title>How to get the fields in each layer of a DynamicMapServiceLayer?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-get-the-fields-in-each-layer-of-a/m-p/234030#M1499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="background-color: #e4e4ff;"&gt;Here's a bit of code I got:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;('layer' is a &lt;SPAN style="background-color: #e4e4ff;"&gt;ArcGISDynamicMapServiceLayer already initialized)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #e4e4ff;"&gt;ArcGISLayerInfo&lt;/SPAN&gt;[] childLayers = layer.getAllLayers();&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;for &lt;/SPAN&gt;(&lt;SPAN style="background-color: #e4e4ff;"&gt;ArcGISLayerInfo&lt;/SPAN&gt; child : childLayers) {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #e4e4ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LayerServiceInfo&lt;/SPAN&gt; serviceInfo = child.getLayerServiceInfo();&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for &lt;/SPAN&gt;(Field field : serviceInfo.getFields()) {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; childInfo.addFieldName(field.getName());&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I print the serviceInfo.toString(), I get:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Layers [id=4, name=Lage druk, defaultVisibility=true, parentLayerId=-1, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; subLayerIds=[5, 19, 20, 21, 22],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geometryType=null,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fields=null,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; objectIdField=null, globalIdField=null, typeIdField=null,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureTypes=null,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hasAttachments=false,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; definitionExpression=null]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can I have access to the fields of an DynamicMapServiceLayer like this?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jan 2016 21:42:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-get-the-fields-in-each-layer-of-a/m-p/234030#M1499</guid>
      <dc:creator>FrancisGagne</dc:creator>
      <dc:date>2016-01-22T21:42:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the fields in each layer of a DynamicMapServiceLayer?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-get-the-fields-in-each-layer-of-a/m-p/234031#M1500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;getLayerServiceInfo method asked for an integer as sublayerId parameter. &lt;/P&gt;&lt;H4 class="jd-details-title" style="margin-top: 1.5em; margin-bottom: 0.5em; padding: 3px 95px 3px 3px; font-size: 1.1em; color: #222222; font-family: arial, sans-serif; background-color: #e2e2e2;"&gt;&lt;SPAN class="normal" style="font-size: 0.9em; font-weight: normal;"&gt;public &lt;A href="https://developers.arcgis.com/android/api-reference/reference/com/esri/core/ags/LayerServiceInfo.html" style="color: #006699;"&gt;LayerServiceInfo&lt;/A&gt; &lt;/SPAN&gt;&lt;SPAN class="sympad" style="margin-right: 2px;"&gt;getLayerServiceInfo&lt;/SPAN&gt; &lt;SPAN class="normal" style="font-size: 0.9em; font-weight: normal;"&gt;(int sublayerId)&lt;/SPAN&gt;&lt;/H4&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/android/api-reference/reference/com/esri/android/map/ags/ArcGISDynamicMapServiceLayer.html#getLayerServiceInfo(int)" title="https://developers.arcgis.com/android/api-reference/reference/com/esri/android/map/ags/ArcGISDynamicMapServiceLayer.html#getLayerServiceInfo(int)"&gt;ArcGISDynamicMapServiceLayer |&amp;nbsp; ArcGIS Android 10.2.7 API&lt;/A&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may put this line into the loop with sublayerId and test, change:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; background-color: #e4e4ff;"&gt;LayerServiceInfo&lt;/SPAN&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt; serviceInfo = child.getLayerServiceInfo();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;to &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; background-color: #e4e4ff;"&gt;LayerServiceInfo&lt;/SPAN&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt; serviceInfo = child.getLayerServiceInfo(sublayerId);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2016 17:48:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-get-the-fields-in-each-layer-of-a/m-p/234031#M1500</guid>
      <dc:creator>MengyiGuo</dc:creator>
      <dc:date>2016-01-27T17:48:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the fields in each layer of a DynamicMapServiceLayer?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-get-the-fields-in-each-layer-of-a/m-p/234032#M1501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;child is a &lt;SPAN style="background-color: #e4e4ff;"&gt;ArcGISLayerInfo&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;So I tried :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;layer.getLayerServiceInfo(child.getId());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but the LayerServiceInfo returned is null.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I really need to call &lt;CODE style="color: #007000; font-size: 13px;"&gt;&lt;A href="https://developers.arcgis.com/android/api-reference/reference/com/esri/android/map/ags/ArcGISDynamicMapServiceLayer.html#fetchLayerServiceInfo(int, com.esri.core.map.CallbackListener&amp;lt;com.esri.core.ags.LayerServiceInfo&amp;gt;)" style="color: #006699;"&gt;fetchLayerServiceInfo(int, CallbackListener)&lt;/A&gt;&lt;/CODE&gt;&lt;SPAN style="color: #333333; font-family: arial, sans-serif; font-size: 13px;"&gt;. on each sublayers in each of my services?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: arial, sans-serif; font-size: 13px;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2016 18:56:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-get-the-fields-in-each-layer-of-a/m-p/234032#M1501</guid>
      <dc:creator>FrancisGagne</dc:creator>
      <dc:date>2016-01-27T18:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the fields in each layer of a DynamicMapServiceLayer?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-get-the-fields-in-each-layer-of-a/m-p/234033#M1502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. You need to fetch the information once in your application, otherwise it will be null. Once you fetched it, it will be stored.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-family: arial, sans-serif; font-size: 13px;"&gt;fetchLayerServiceInfo asynchronously fetches the &lt;/SPAN&gt;&lt;CODE style="color: #007000; font-size: 13px;"&gt;&lt;A href="https://developers.arcgis.com/android/api-reference/reference/com/esri/core/ags/LayerServiceInfo.html" style="color: #006699;"&gt;LayerServiceInfo&lt;/A&gt;&lt;/CODE&gt;&lt;SPAN style="color: #333333; font-family: arial, sans-serif; font-size: 13px;"&gt; for the specified sublayer. If the LayerServiceInfo has already been fetched, then it will simply return that. Otherwise a network request will be made to fetch it. Once it has been fetched, it will be cached so that&lt;/SPAN&gt;&lt;CODE style="color: #007000; font-size: 13px;"&gt;&lt;A href="https://developers.arcgis.com/android/api-reference/reference/com/esri/android/map/ags/ArcGISDynamicMapServiceLayer.html#getLayerServiceInfo(int)" style="color: #006699;"&gt;getLayerServiceInfo(int)&lt;/A&gt;&lt;/CODE&gt;&lt;SPAN style="color: #333333; font-family: arial, sans-serif; font-size: 13px;"&gt; will return it, and so that it won't be fetched more than once.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2016 19:01:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-get-the-fields-in-each-layer-of-a/m-p/234033#M1502</guid>
      <dc:creator>MengyiGuo</dc:creator>
      <dc:date>2016-01-27T19:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the fields in each layer of a DynamicMapServiceLayer?</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-get-the-fields-in-each-layer-of-a/m-p/234034#M1503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay, I'll implement that and return here with the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2016 20:06:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-get-the-fields-in-each-layer-of-a/m-p/234034#M1503</guid>
      <dc:creator>FrancisGagne</dc:creator>
      <dc:date>2016-01-27T20:06:51Z</dc:date>
    </item>
  </channel>
</rss>

