<?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: Using ArcGISFeatureLayer offline in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503850#M3461</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Can you please tell me how did you manage to get the layer definition dynamically through code. I can see that in the "CreateJSONLocalMaps" project, the layer definition is hardcoded in the "strings.xml". I have nearly 90 layers for which i want to dynamically fetch the layer definition.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I send request to my ArcGis Service using layer url + "?f=pjson". Get this json and save it to the file. And then using layer definition from this file.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 11 May 2014 01:29:32 GMT</pubDate>
    <dc:creator>KonstantinKurtukov</dc:creator>
    <dc:date>2014-05-11T01:29:32Z</dc:date>
    <item>
      <title>Using ArcGISFeatureLayer offline</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503842#M3453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm trying to use an ArcGISFeatureLayer offline. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Graphic[] graphics = new Graphic[baumLayerFields.length];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ArrayList&amp;lt;Field&amp;gt; fields = new ArrayList&amp;lt;Field&amp;gt;();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FeatureSet featureSet = new FeatureSet();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for (int i = 0; i &amp;lt; baumLayerFields.length; i++)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Field f = new Field(baumLayerFields&lt;I&gt;,baumLayerFields&lt;I&gt;,"esriFieldTypeString");&lt;/I&gt;&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; fields.add(f); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;featureSet.setFields(fields);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;for (all features in my local storage)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hashtable&amp;lt;String,Object&amp;gt; map = new Hashtable&amp;lt;String,Object&amp;gt;();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;map.put("OBJECTID", String.valueOf(i));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;map.put("VNK", baeume.get(i).getVNK());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;map.put("NNK", baeume.get(i).getNNK());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;map.put("VST", baeume.get(i).getVST());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;PictureMarkerSymbol pms = new PictureMarkerSymbol(drawable);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;InfoTemplate infoTemplate = new InfoTemplate();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Point p = new Point();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;p.setX(baeume.get(i).getX());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;p.setY(baeume.get(i).getY());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SimpleMarkerSymbol sms = new SimpleMarkerSymbol(Color.RED, 50, SimpleMarkerSymbol.STYLE.CIRCLE);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Graphic g = new Graphic(p,sms,map,infoTemplate);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;graphics&lt;I&gt; = g;&lt;/I&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;featureSet.setGraphics(graphics);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;featureSet.setSpatialReference(new SpatialReference("\"wkid\":31468"));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;fLayer = new ArcGISFeatureLayer(null,featureSet, o);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My Problem is, that i have an extent, but cant see any features. I also dont understand how the LayerDefinition for the ArcGISFeatureLayer should look like. I have tried some, but nothing seems to work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone an idea, or is there a better approach?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kind regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Kevin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Dec 2012 13:14:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503842#M3453</guid>
      <dc:creator>KevinGebhardt</dc:creator>
      <dc:date>2012-12-19T13:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcGISFeatureLayer offline</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503843#M3454</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Offline support is not currently supported, but it is slated for the next release.&amp;nbsp; See this thread: &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/73749-Offline-Use-March-2012"&gt;http://forums.arcgis.com/threads/73749-Offline-Use-March-2012&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2012 11:31:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503843#M3454</guid>
      <dc:creator>deleted-user-ATjHIWsdQYmT</dc:creator>
      <dc:date>2012-12-20T11:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcGISFeatureLayer offline</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503844#M3455</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;But when I'm looking at the API-Documentation of ArcGISFeatureLayer there is the following constructor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;public ArcGISFeatureLayer(String layerDefinition,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FeatureSet featureCollection,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ArcGISFeatureLayer.Options layerOption)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The constructor is used if you are instantiating the ArcGISFeatureLayer using a feature collection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The feature layer, when initialized with a feature collection object has the following behavior:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Edits are applied on the client not posted to the server.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The feature layer generates a unique ObjectId for new features.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; All queries are done on the client side.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Does not support operations that need to be performed on the server, e.g. attachment, appyEdit. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So i can create a FeatureSet from given coords from a local source (file system, database) and give it to the FeatureLayer.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Dec 2012 11:52:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503844#M3455</guid>
      <dc:creator>KevinGebhardt</dc:creator>
      <dc:date>2012-12-20T11:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcGISFeatureLayer offline</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503845#M3456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The ArcGISFeatureLayer(String layerDefinition, FeatureSet featureCollection, ArcGISFeatureLayer.Options layerOption) cannot have a null layer definition.&amp;nbsp; You need to create a string resource and populate it with your layer definition.&amp;nbsp; You can look at ArcGIS Services directory to see what a layer definition looks like, e.g. &lt;/SPAN&gt;&lt;A href="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/5?f=json&amp;amp;pretty=true" rel="nofollow noopener noreferrer" target="_blank"&gt;ESRI USA Census States layer definition&lt;/A&gt;&lt;SPAN&gt;.&amp;nbsp; Your code needs the layer definition defined by baumLayerFields presumably.&amp;nbsp; Below I offer a working example from one of the SDK samples.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Take a look at the &lt;/SPAN&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=4f02eed4a00b40cfb8c0149bd09f2b02" rel="nofollow noopener noreferrer" target="_blank"&gt;CreateLocalJsonFeatures sample&lt;/A&gt;&lt;SPAN&gt; for an example of creating an offline ArcGISFeatureLayer from an existing &lt;/SPAN&gt;&lt;A href="http://mobilesampleserver.arcgisonline.com/ArcGIS/rest/services/DemoData/WindfarmSDKDemo/FeatureServer/0?f=pjson" rel="nofollow noopener noreferrer" target="_blank"&gt;FeatureLayer online&lt;/A&gt;&lt;SPAN&gt;.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the sample an ArcGISFeatureLayer is created from &lt;/SPAN&gt;&lt;A href="http://mobilesampleserver.arcgisonline.com/ArcGIS/rest/services/DemoData/WindfarmSDKDemo/FeatureServer/0" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcGIS Online&lt;/A&gt;&lt;SPAN&gt;.&amp;nbsp; The sample allows users to sketch a polygon to query the ArcGISFeatureLayer and submit the query results to create an offline subset of the ArcGISFeatureLayer.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Query the online ArcGISFeatureLayer&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Query query = new Query();
&amp;nbsp;&amp;nbsp;&amp;nbsp; // set spatial reference 
&amp;nbsp;&amp;nbsp;&amp;nbsp; SpatialReference sr = SpatialReference.create(102100);
&amp;nbsp;&amp;nbsp;&amp;nbsp; // set the geometry to the sketch polygon
&amp;nbsp;&amp;nbsp;&amp;nbsp; query.setGeometry(selection);
&amp;nbsp;&amp;nbsp;&amp;nbsp; // query features that are completely contained by selection
&amp;nbsp;&amp;nbsp;&amp;nbsp; query.setSpatialRelationship(SpatialRelationship.CONTAINS);
&amp;nbsp;&amp;nbsp;&amp;nbsp; // set query in/out spatial ref
&amp;nbsp;&amp;nbsp;&amp;nbsp; query.setInSpatialReference(sr);
&amp;nbsp;&amp;nbsp;&amp;nbsp; query.setOutSpatialReference(sr);
&amp;nbsp;&amp;nbsp;&amp;nbsp; // return all features
&amp;nbsp;&amp;nbsp;&amp;nbsp; query.setOutFields(new String[]{"*"});
&amp;nbsp;&amp;nbsp;&amp;nbsp; // include geometry in result set
&amp;nbsp;&amp;nbsp;&amp;nbsp; query.setReturnGeometry(true);
&amp;nbsp;&amp;nbsp;&amp;nbsp; // run query on FeatureLayer off UI thread
&amp;nbsp;&amp;nbsp;&amp;nbsp; windTurbine.queryFeatures(query, new CallbackListener&amp;lt;FeatureSet&amp;gt;() {
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The result of the query is a FeatureSet result.&amp;nbsp; FeatureSet has to/fromJson methods that allow you to persist the features to json and locally on device.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // create feature set as json string
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String fsstring = FeatureSet.toJson(result);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // create fully qualified path for json file
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; path = createJsonFile();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // create a File from json fully qualified path
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; File outfile = new File(path);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // create output stream to write to json file
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outstream = new FileOutputStream(outfile);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outstream.write(fsstring.getBytes());
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // close output stream
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outstream.close();
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The json local file path can be used to create an offline FeatureSet&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp; 
public FeatureSet createWindTurbinesFeatureSet(String path) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; FeatureSet fs = null;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; try {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; JsonFactory factory = new JsonFactory();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; JsonParser parser = factory.createJsonParser(new FileInputStream(path));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parser.nextToken();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fs = FeatureSet.fromJson(parser);
&amp;nbsp;&amp;nbsp;&amp;nbsp; } catch (Exception e) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; e.printStackTrace();
&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; return fs;
&amp;nbsp; } 
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;With a Layer Definition defined and a populated offline FeatureSet from json you can create your offline ArcGISFeatureLayer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Create wind turbine featurelayer from json
&amp;nbsp;&amp;nbsp;&amp;nbsp; windTurbineFeatureSet = createWindTurbinesFeatureSet(jsonPath);
&amp;nbsp;&amp;nbsp;&amp;nbsp; windTurbineLayerDefinition = this.getResources().getString(R.string.config_windturbine_layer_definition);
&amp;nbsp;&amp;nbsp;&amp;nbsp; ArcGISFeatureLayer.Options layerOptions = new ArcGISFeatureLayer.Options();
&amp;nbsp;&amp;nbsp;&amp;nbsp; layerOptions.mode = ArcGISFeatureLayer.MODE.SNAPSHOT;

&amp;nbsp;&amp;nbsp;&amp;nbsp; // create the offline feature layer
&amp;nbsp;&amp;nbsp;&amp;nbsp; windTurbinesFeatureLayer = new ArcGISFeatureLayer(windTurbineLayerDefinition, windTurbineFeatureSet, layerOptions);
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this helps&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:06:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503845#M3456</guid>
      <dc:creator>DanO_Neill</dc:creator>
      <dc:date>2021-12-11T22:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcGISFeatureLayer offline</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503846#M3457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;about the layer definition... how do I create a string resource and populate it with my layer definition?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it only possible through ArcGIS Server/ ArcGIS online, or do I have other options?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Mar 2013 08:13:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503846#M3457</guid>
      <dc:creator>AxelBronder1</dc:creator>
      <dc:date>2013-03-12T08:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcGISFeatureLayer offline</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503847#M3458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll try to load feature layer offline. I used code such as in example Wind Turbines. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I send query to layer, save json to file, get definition from server.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But there are not features on map. Why is this happening?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 10:41:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503847#M3458</guid>
      <dc:creator>KonstantinKurtukov</dc:creator>
      <dc:date>2014-03-18T10:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcGISFeatureLayer offline</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503848#M3459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi all.&lt;BR /&gt;I'll try to load feature layer offline. I used code such as in example Wind Turbines. &lt;BR /&gt;I send query to layer, save json to file, get definition from server.&lt;BR /&gt;But there are not features on map. Why is this happening?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I resolved my problem. This happenes when i try load few layers simultaneously. Need to wait while first load, save it to json and then load another.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Mar 2014 02:02:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503848#M3459</guid>
      <dc:creator>KonstantinKurtukov</dc:creator>
      <dc:date>2014-03-28T02:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcGISFeatureLayer offline</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503849#M3460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi all.&lt;BR /&gt;I'll try to load feature layer offline. I used code such as in example Wind Turbines. &lt;BR /&gt;I send query to layer, save json to file, get definition from server.&lt;BR /&gt;But there are not features on map. Why is this happening?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you please tell me how did you manage to get the layer definition dynamically through code. I can see that in the "CreateJSONLocalMaps" project, the layer definition is hardcoded in the "strings.xml". I have nearly 90 layers for which i want to dynamically fetch the layer definition.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 10 May 2014 10:32:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503849#M3460</guid>
      <dc:creator>VansiKrishna</dc:creator>
      <dc:date>2014-05-10T10:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcGISFeatureLayer offline</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503850#M3461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Can you please tell me how did you manage to get the layer definition dynamically through code. I can see that in the "CreateJSONLocalMaps" project, the layer definition is hardcoded in the "strings.xml". I have nearly 90 layers for which i want to dynamically fetch the layer definition.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I send request to my ArcGis Service using layer url + "?f=pjson". Get this json and save it to the file. And then using layer definition from this file.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 May 2014 01:29:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503850#M3461</guid>
      <dc:creator>KonstantinKurtukov</dc:creator>
      <dc:date>2014-05-11T01:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcGISFeatureLayer offline</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503851#M3462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I send request to my ArcGis Service using layer url + "?f=pjson". Get this json and save it to the file. And then using layer definition from this file.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello kosmich,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes i know that format. I used to do the same for all of my layers until the ArcGIS service url was open and executable through query string. But now, the service url is authenticated. It needs a security token for free access. Now i cannot use the above process since it always returns me the following result.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;{
 "error": {
&amp;nbsp; "code": 499,
&amp;nbsp; "message": "Token Required",
&amp;nbsp; "details": []
 }
}&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Not to show my layer data in offline mode, firstly i am getting the instance of ArcGISFeatureLayer and then Query the data for a selected boundary. I now use the following approach to get the instance of ArcGISFeatureLayer :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;UserCredentials creds = new UserCredentials();
creds.setUserAccount("username", "password");
creds.setUserToken("token", "AkwekUYsasaYU");&amp;nbsp;&amp;nbsp;&amp;nbsp; 
ArcGISDynamicMapServiceLayer layer = new ArcGISDynamicMapServiceLayer(
&amp;nbsp; "http://servicesbeta.esri.com/ArcGIS/rest/services/SanJuan/TrailConditions/MapServer", null,creds);&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am also able to get the data too. But to show them on an offline layer i would need the layer definition as string. What to do now?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 22:06:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503851#M3462</guid>
      <dc:creator>VansiKrishna</dc:creator>
      <dc:date>2021-12-11T22:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using ArcGISFeatureLayer offline</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503852#M3463</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;I am also able to get the data too. But to show them on an offline layer i would need the layer definition as string. What to do now?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hello.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For each layer you must send two requests: first - load layer (using ArcGISFeatureLayer, ArcGISDynamicMapServiceLayer or smth else) and then using query for save layer in json file (may use Wind Turbine example), second request - load definition for layer (using layer url + "?f=pjson" for request's url) and save response. For send second request i use third-party lib, you may use smth else (HTTPClient mb).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 May 2014 05:01:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/using-arcgisfeaturelayer-offline/m-p/503852#M3463</guid>
      <dc:creator>KonstantinKurtukov</dc:creator>
      <dc:date>2014-05-12T05:01:36Z</dc:date>
    </item>
  </channel>
</rss>

