<?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 add a FeatureLayer published by ArcGIS Server in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-add-a-featurelayer-published-by-arcgis/m-p/1016807#M5406</link>
    <description>&lt;P&gt;I've tried adding your feature later to a map using our latest release (100.9.0) and it displayed without any issues.&lt;/P&gt;&lt;P&gt;I was basically swapping your service into this app on github:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-runtime-samples-android/tree/master/kotlin/feature-layer-feature-service" target="_blank"&gt;https://github.com/Esri/arcgis-runtime-samples-android/tree/master/kotlin/feature-layer-feature-service&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I had to zoom to a different area, but I could see your data:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarkBaird_0-1610624622260.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/3860i5265206B3680EEF3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarkBaird_0-1610624622260.png" alt="MarkBaird_0-1610624622260.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Does using this code help?&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jan 2021 11:44:27 GMT</pubDate>
    <dc:creator>MarkBaird</dc:creator>
    <dc:date>2021-01-14T11:44:27Z</dc:date>
    <item>
      <title>How to add a FeatureLayer published by ArcGIS Server</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-add-a-featurelayer-published-by-arcgis/m-p/1016777#M5405</link>
      <description>&lt;P&gt;HELLO，&lt;/P&gt;&lt;P&gt;I published the service using ArcGIS Server，and load it success with JS API.&lt;/P&gt;&lt;PRE&gt;var layerss &lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;new &lt;/SPAN&gt;&lt;SPAN&gt;FeatureLayer&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;{&lt;BR /&gt;&lt;/SPAN&gt;        &lt;SPAN&gt;url&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;"https://hbsyb.booway.com.cn/arcgis/rest/services/zjsxyd/sichuanxianjixingzhengqu/MapServer/0"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;        outFields &lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;"*"&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;BR /&gt;&lt;/SPAN&gt;        opacity &lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;0.5&lt;BR /&gt;&lt;/SPAN&gt;    &lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;BR /&gt;&lt;/SPAN&gt;map&lt;SPAN&gt;.&lt;/SPAN&gt;add&lt;SPAN&gt;(&lt;/SPAN&gt;layerss&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;bud when i want to load it with Android Runtime Sdk 100.5.0(FeatureLayer), it doesn't work.&lt;/P&gt;&lt;P&gt;What shall I do?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 07:19:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-add-a-featurelayer-published-by-arcgis/m-p/1016777#M5405</guid>
      <dc:creator>wanglong</dc:creator>
      <dc:date>2021-01-14T07:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a FeatureLayer published by ArcGIS Server</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-add-a-featurelayer-published-by-arcgis/m-p/1016807#M5406</link>
      <description>&lt;P&gt;I've tried adding your feature later to a map using our latest release (100.9.0) and it displayed without any issues.&lt;/P&gt;&lt;P&gt;I was basically swapping your service into this app on github:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-runtime-samples-android/tree/master/kotlin/feature-layer-feature-service" target="_blank"&gt;https://github.com/Esri/arcgis-runtime-samples-android/tree/master/kotlin/feature-layer-feature-service&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I had to zoom to a different area, but I could see your data:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarkBaird_0-1610624622260.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/3860i5265206B3680EEF3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarkBaird_0-1610624622260.png" alt="MarkBaird_0-1610624622260.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Does using this code help?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jan 2021 11:44:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-add-a-featurelayer-published-by-arcgis/m-p/1016807#M5406</guid>
      <dc:creator>MarkBaird</dc:creator>
      <dc:date>2021-01-14T11:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a FeatureLayer published by ArcGIS Server</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-add-a-featurelayer-published-by-arcgis/m-p/1017147#M5407</link>
      <description>&lt;P&gt;Thank you. It helped me a lot.&lt;/P&gt;&lt;P&gt;I found out the problem is that for the sake of security, Google has explicitly prohibited the amount of HTTP protocol on Android P, so I set it the "android: networkSecurityConfig" in my code.&amp;nbsp; Therefore,&amp;nbsp;&amp;nbsp;I successfully loaded the layer(&lt;A href="https://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/MapServer/9" target="_blank"&gt;https://sampleserver6.arcgisonline.com/arcgis/rest/services/Energy/Geology/MapServer/9&lt;/A&gt;) when I removed it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, what puzzles me is that i still couldn't load my&amp;nbsp;&lt;SPAN&gt;service, even if i imported the app on GitHub and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt; replaced my sdk version to 100.9.0.&lt;span class="lia-unicode-emoji" title=":pensive_face:"&gt;😔&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Did to just replaced the service url in the sample's code?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Looking forward to hearing from you.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jan 2021 02:30:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-add-a-featurelayer-published-by-arcgis/m-p/1017147#M5407</guid>
      <dc:creator>wanglong</dc:creator>
      <dc:date>2021-01-15T02:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a FeatureLayer published by ArcGIS Server</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-add-a-featurelayer-published-by-arcgis/m-p/1017604#M5408</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hey, MarkBaird.&amp;nbsp;Please tell me if your screenshot is a mobile phone screenshot？&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2021 07:34:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-add-a-featurelayer-published-by-arcgis/m-p/1017604#M5408</guid>
      <dc:creator>wanglong</dc:creator>
      <dc:date>2021-01-18T07:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a FeatureLayer published by ArcGIS Server</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-add-a-featurelayer-published-by-arcgis/m-p/1017648#M5409</link>
      <description>&lt;P&gt;The screenshot in my previous post was grabbed from running it in a desktop Java Runtime app which was for convenience.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I does however work on in my Kotlin Android app too.&amp;nbsp; This is the modified onCreate method from my app:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="kotlin"&gt;  override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)

    // create the service feature table
    val serviceFeatureTable = ServiceFeatureTable("https://hbsyb.booway.com.cn/arcgis/rest/services/zjsxyd/sichuanxianjixingzhengqu/MapServer/0");

    // create the feature layer using the service feature table
    val featureLayer = FeatureLayer(serviceFeatureTable)

    // create a map with the terrain with labels basemap
    ArcGISMap(Basemap.createTerrainWithLabels()).let { map -&amp;gt;
      // set an initial viewpoint
      //map.initialViewpoint = Viewpoint(
      //  Point(
      //    -13176752.0,
      //    4090404.0,
      //    SpatialReferences.getWebMercator()
      //  ), 500000.0
      //)

      // add the feature layer to the map
      map.operationalLayers.add(featureLayer)

      featureLayer.loadAsync()
      featureLayer.addDoneLoadingListener {
        val extent: Envelope = featureLayer.getFullExtent()

        mapView.setViewpointGeometryAsync(extent)
      }

      // set the map to be displayed in the mapview
      mapView.map = map
    }
  }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This zooms to the extent of the layer once it is loaded and on my Samsung phone looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MarkBaird_4-1610970430116.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/4005i026D1A4F36053D5D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MarkBaird_4-1610970430116.png" alt="MarkBaird_4-1610970430116.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you use my code, does this work for you?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2021 12:11:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-add-a-featurelayer-published-by-arcgis/m-p/1017648#M5409</guid>
      <dc:creator>MarkBaird</dc:creator>
      <dc:date>2021-01-18T12:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to add a FeatureLayer published by ArcGIS Server</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-add-a-featurelayer-published-by-arcgis/m-p/1017653#M5410</link>
      <description>&lt;P&gt;I have had some instances when the service hasn't loaded.&amp;nbsp; I basically wasn't getting a response from the server and it timed out.&lt;/P&gt;&lt;P&gt;The code sample above could be made more robust by checking the load status of the feature layer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="kotlin"&gt;      featureLayer.loadAsync()
      featureLayer.addDoneLoadingListener {
        //Toast.makeText(this, "loaded", 3)
        if (featureLayer.loadStatus == LoadStatus.FAILED_TO_LOAD) {
          Toast.makeText(this, "failed to load " + featureLayer.loadError.message, Toast.LENGTH_SHORT).show()

        } else {


          Toast.makeText(this, "loaded okay", Toast.LENGTH_SHORT).show()
          val extent: Envelope = featureLayer.getFullExtent()

          mapView.setViewpointGeometryAsync(extent)
        }
      }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2021 12:07:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/how-to-add-a-featurelayer-published-by-arcgis/m-p/1017653#M5410</guid>
      <dc:creator>MarkBaird</dc:creator>
      <dc:date>2021-01-18T12:07:16Z</dc:date>
    </item>
  </channel>
</rss>

