<?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: Graphic's Map-type attribute to also hold and return objects, rather than just string in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-s-map-type-attribute-to-also-hold-and/m-p/467264#M3165</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's on version 10.2.8-1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The objects are just plain made Java object. (e.g. a custom data structure)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Nov 2016 13:25:05 GMT</pubDate>
    <dc:creator>JasonChristian</dc:creator>
    <dc:date>2016-11-28T13:25:05Z</dc:date>
    <item>
      <title>Graphic's Map-type attribute to also hold and return objects, rather than just string</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-s-map-type-attribute-to-also-hold-and/m-p/467262#M3163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the problem with Graphic object. The object can have a Map of data that can be retrieved when the user clicks on the drawn Graphic on the map. One of the constructor of the Graphic class has a parameter with type &lt;SPAN style="font-family: courier new,courier,monospace; color: #0000ff;"&gt;Map&amp;lt;String, Object&amp;gt; &lt;SPAN style="color: #000000; font-family: arial,helvetica,sans-serif;"&gt;to store data&lt;/SPAN&gt;&lt;/SPAN&gt;, but somehow, when I retrieved it using &lt;SPAN style="color: #0000ff; font-family: courier new,courier,monospace;"&gt;Graphic.getAttributes()&lt;/SPAN&gt; and access the value inside the Map, it returns a string (or &lt;SPAN style="color: #0000ff; font-family: courier new,courier,monospace;"&gt;ClassCastException&lt;/SPAN&gt; when I try to cast it to an object of desired type, which of course, is derived from Object class)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems that the method cast all the Map values into string (maybe using &lt;SPAN style="color: #0000ff; font-family: courier new,courier,monospace;"&gt;toString()&lt;/SPAN&gt; method). This is quite problematic, especially when the user wants to put a custom Object type to the Map as value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;SPAN style="color: #0000ff; font-family: courier new,courier,monospace;"&gt;Graphic&lt;/SPAN&gt; object should be able to store and return back the object without changing it to &lt;SPAN style="color: #0000ff; font-family: courier new,courier,monospace;"&gt;String&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #333333;"&gt;HashMap&amp;lt;String, Object&amp;gt; data = new HashMap&amp;lt;String, Object&amp;gt;()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #333333;"&gt;MyObject obj = new MyObject();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #333333;"&gt;data.put("data", obj);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #333333;"&gt;Graphic g = new Graphic(point, image, data);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier,monospace; color: #333333;"&gt;MyObject selected = (MyObject) g.getAttributes().get("data"); // Exception here&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Nov 2016 13:15:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-s-map-type-attribute-to-also-hold-and/m-p/467262#M3163</guid>
      <dc:creator>JasonChristian</dc:creator>
      <dc:date>2016-11-25T13:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: Graphic's Map-type attribute to also hold and return objects, rather than just string</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-s-map-type-attribute-to-also-hold-and/m-p/467263#M3164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/193751"&gt;Jason Christian&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this Runtime version 100 or is this version 10.2.8-1?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additionally, what type of object are you trying to store?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Alexander&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 13:18:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-s-map-type-attribute-to-also-hold-and/m-p/467263#M3164</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2016-11-28T13:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Graphic's Map-type attribute to also hold and return objects, rather than just string</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-s-map-type-attribute-to-also-hold-and/m-p/467264#M3165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's on version 10.2.8-1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The objects are just plain made Java object. (e.g. a custom data structure)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 13:25:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-s-map-type-attribute-to-also-hold-and/m-p/467264#M3165</guid>
      <dc:creator>JasonChristian</dc:creator>
      <dc:date>2016-11-28T13:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Graphic's Map-type attribute to also hold and return objects, rather than just string</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-s-map-type-attribute-to-also-hold-and/m-p/467265#M3166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/people/ihazbackup"&gt;ihazbackup&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a sinking suspicion that custom data types are not supported. &amp;nbsp;The feeling is that if ArcGIS Online supports the data type that it would be supported here as the data type is supposed to mirror that of field data that you would find in ArcGIS Online. &amp;nbsp;A workaround might be to convert the POJO to a BLOB and then store it and when you go to retrieve it, convert the BLOB back to a POJO. &amp;nbsp;This is just a guess and can vary from data type to data type. &amp;nbsp;I will investigate some more on my end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Alexander&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 13:38:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-s-map-type-attribute-to-also-hold-and/m-p/467265#M3166</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2016-11-28T13:38:40Z</dc:date>
    </item>
    <item>
      <title>Re: Graphic's Map-type attribute to also hold and return objects, rather than just string</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-s-map-type-attribute-to-also-hold-and/m-p/467266#M3167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Currently only String is supported on the android's arcgis SDK. Aside from POJO, you can also use GSON to store the data structure as JSON string. But, for a complex object, it might not suffice.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 13:42:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-s-map-type-attribute-to-also-hold-and/m-p/467266#M3167</guid>
      <dc:creator>JasonChristian</dc:creator>
      <dc:date>2016-11-28T13:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Graphic's Map-type attribute to also hold and return objects, rather than just string</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-s-map-type-attribute-to-also-hold-and/m-p/467267#M3168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/people/ihazbackup"&gt;ihazbackup&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on that response, I take it that you are having trouble storing longs, doubles, and booleans in the map?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Alexander&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 13:45:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-s-map-type-attribute-to-also-hold-and/m-p/467267#M3168</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2016-11-28T13:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Graphic's Map-type attribute to also hold and return objects, rather than just string</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-s-map-type-attribute-to-also-hold-and/m-p/467268#M3169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Currently, I don't have a problem with storing data on a Graphic marker (because I just changed the algorithm to just search on the list of objects rather than type-casting the attributes from HashMap). I just want to address the problem of not being able to retrieve objects from attributes from Graphic marker&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 13:53:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-s-map-type-attribute-to-also-hold-and/m-p/467268#M3169</guid>
      <dc:creator>JasonChristian</dc:creator>
      <dc:date>2016-11-28T13:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Graphic's Map-type attribute to also hold and return objects, rather than just string</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-s-map-type-attribute-to-also-hold-and/m-p/467269#M3170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/people/ihazbackup"&gt;ihazbackup&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Earlier you mentioned that only strings are supported but are you able to store other primitive data types (longs, doubles, booleans, etc...) in the Graphics object and retrieve them? &amp;nbsp;This will help us understand the exact behavior that you are experiencing and we will be better able to address it. &amp;nbsp;Based upon the documentation, I would beleive that only field types that are supported by ArcGIS Online are supported in the graphics attributes property. &amp;nbsp;These fields are Date, Double, Integer, and String. &amp;nbsp;I will need to investigate more on my end to bring back more information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Alexander&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Nov 2016 14:04:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-s-map-type-attribute-to-also-hold-and/m-p/467269#M3170</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2016-11-28T14:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Graphic's Map-type attribute to also hold and return objects, rather than just string</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-s-map-type-attribute-to-also-hold-and/m-p/467270#M3171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/193751"&gt;Jason Christian&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the documentation for Graphic,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P style="color: #333333; background-color: #ffffff; border: 0px; font-size: 13px; margin: 0px 0px 1em; padding: 0px;"&gt;A Graphic's attributes are stored in a Map. Supported value types are restricted to the following list:&lt;/P&gt;&lt;UL style="color: #333333; background-color: #ffffff; border: 0px; font-size: 13px; margin: 0px 0px 0.8em; padding: 0px 0px 0px 2em;"&gt;&lt;LI style="border: 0px; margin: 0px; padding: 0px 0px 0.5em;"&gt;Short&lt;/LI&gt;&lt;LI style="border: 0px; margin: 0px; padding: 0px 0px 0.5em;"&gt;Integer&lt;/LI&gt;&lt;LI style="border: 0px; margin: 0px; padding: 0px 0px 0.5em;"&gt;Long&lt;/LI&gt;&lt;LI style="border: 0px; margin: 0px; padding: 0px 0px 0.5em;"&gt;Float&lt;/LI&gt;&lt;LI style="border: 0px; margin: 0px; padding: 0px 0px 0.5em;"&gt;Double&lt;/LI&gt;&lt;LI style="border: 0px; margin: 0px; padding: 0px 0px 0.5em;"&gt;Boolean&lt;/LI&gt;&lt;LI style="border: 0px; margin: 0px; padding: 0px 0px 0.5em;"&gt;String&lt;/LI&gt;&lt;LI style="border: 0px; margin: 0px; padding: 0px 0px 0.5em;"&gt;Date&lt;/LI&gt;&lt;LI style="border: 0px; margin: 0px; padding: 0px 0px 0.5em;"&gt;Calendar&lt;/LI&gt;&lt;LI style="border: 0px; margin: 0px; padding: 0px 0px 0.5em;"&gt;null&lt;/LI&gt;&lt;/UL&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This means that if you want to store an Object inside the map, it needs to conform to one of the listed data types. &amp;nbsp;You can find more information on Graphics at this link:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://developers.arcgis.com/android/10-2/api-reference/reference/com/esri/core/map/Graphic.html" title="https://developers.arcgis.com/android/10-2/api-reference/reference/com/esri/core/map/Graphic.html"&gt;Graphic | ArcGIS Android 10.2.8 API&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Dec 2016 14:32:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/graphic-s-map-type-attribute-to-also-hold-and/m-p/467270#M3171</guid>
      <dc:creator>AlexanderNohe1</dc:creator>
      <dc:date>2016-12-01T14:32:35Z</dc:date>
    </item>
  </channel>
</rss>

