<?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: Callbacks for network analyst tasks in ArcGIS Runtime SDK for Android Questions</title>
    <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/callbacks-for-network-analyst-tasks/m-p/584238#M3994</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is an excellent post on creating a resuable Asynctask class&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://stackoverflow.com/questions/9963691/android-asynctask-sending-callbacks-to-ui"&gt;http://stackoverflow.com/questions/9963691/android-asynctask-sending-callbacks-to-ui&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can follow the same approach for the NA tasks in Esri and implement the callback in your main class.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 08 Jun 2013 18:32:30 GMT</pubDate>
    <dc:creator>ThomasBinu</dc:creator>
    <dc:date>2013-06-08T18:32:30Z</dc:date>
    <item>
      <title>Callbacks for network analyst tasks</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/callbacks-for-network-analyst-tasks/m-p/584236#M3992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi ,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am new to Esri android developer scene. I have prior experience with the&amp;nbsp; Arcgis sdk for javascript and silverlight. I was trying to get&amp;nbsp; a basic routing application running on my device. For other Arcgis&amp;nbsp; APIs,&amp;nbsp; a callback method is provided by the API to handle the results of a network operation(like routing or query task). But in the Arcgis api for andoid, we are required to write Async tasks or handler methods. Is there a particular reason the android API was designed this way?. Why didnt ESRI make use of listeners/callbacks to handle the results from network operations. Writing our own handler methods not only takes a lot of time , but also makes it very difficult to write clean and reusable code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, the routing sample makes use of handlers/threads while the query task sample makes use of the Asynctask class. Which is the better method to implement routing task?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jun 2013 13:03:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/callbacks-for-network-analyst-tasks/m-p/584236#M3992</guid>
      <dc:creator>SusanMathew</dc:creator>
      <dc:date>2013-06-07T13:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Callbacks for network analyst tasks</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/callbacks-for-network-analyst-tasks/m-p/584237#M3993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I have a few pointers that will hopefully shed some light on your comments and concerns.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;Is there a particular reason the android API was designed this way?. Why didnt ESRI make use of listeners/callbacks to handle the results from network operations. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please note, this is a native Android Operating System programming pattern that is adopted from its Java-based roots. Our API team tries their best to promote best practices for the Android/Java development environment. We take similar approaches for the other APIs you mentioned. For example, you'll see a different pattern for the iOS developer environment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;Which is the better method to implement routing task?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;AsyncTask, Handlers and Threads all have their pluses and minuses and they are also related. The AsyncTask pattern is considered to be the easiest way to learn implementing multi-threading and to properly resynchronize results back to the main user interface thread. Since Android is multi-threaded it is recommended to understand all three of these approaches when building applications. There are some excellent discussions on StackOverflow for example: &lt;/SPAN&gt;&lt;A href="http://stackoverflow.com/questions/6964011/handler-vs-asynctask-vs-thread"&gt;http://stackoverflow.com/questions/6964011/handler-vs-asynctask-vs-thread&lt;/A&gt;&lt;SPAN&gt;. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For reference, here is an Android Best Practices article on &lt;/SPAN&gt;&lt;A href="http://developer.android.com/guide/components/processes-and-threads.html"&gt;Processes and Threads&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;These concepts, patterns and practices may seem a bit foreign at first if you've been using other programming languages. I hope these links help get you pointed in the right direction.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Andy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jun 2013 22:21:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/callbacks-for-network-analyst-tasks/m-p/584237#M3993</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2013-06-07T22:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: Callbacks for network analyst tasks</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/callbacks-for-network-analyst-tasks/m-p/584238#M3994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Here is an excellent post on creating a resuable Asynctask class&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://stackoverflow.com/questions/9963691/android-asynctask-sending-callbacks-to-ui"&gt;http://stackoverflow.com/questions/9963691/android-asynctask-sending-callbacks-to-ui&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can follow the same approach for the NA tasks in Esri and implement the callback in your main class.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Jun 2013 18:32:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/callbacks-for-network-analyst-tasks/m-p/584238#M3994</guid>
      <dc:creator>ThomasBinu</dc:creator>
      <dc:date>2013-06-08T18:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: Callbacks for network analyst tasks</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/callbacks-for-network-analyst-tasks/m-p/584239#M3995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How do I implement a timeout for a&amp;nbsp; querytask running on a Asynctask class.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jun 2013 04:17:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/callbacks-for-network-analyst-tasks/m-p/584239#M3995</guid>
      <dc:creator>adityamehta</dc:creator>
      <dc:date>2013-06-18T04:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Callbacks for network analyst tasks</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/callbacks-for-network-analyst-tasks/m-p/584240#M3996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear Andy,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Although I understand that using Asynctask classes and threads is the native android way, since NA tasks like routing, querytasks are always supposed to run outside the UI thread, couldnt this threading be build into the API itself. Similar to how libraries like volley(new android library for networking) or this &lt;/SPAN&gt;&lt;A href="http://loopj.com/android-async-http/"&gt;http library &lt;/A&gt;&lt;SPAN&gt; is designed ,&amp;nbsp; the&amp;nbsp; API can provide listeners and callbacks for handling the results of a NA operation?. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tom&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 05:19:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/callbacks-for-network-analyst-tasks/m-p/584240#M3996</guid>
      <dc:creator>ThomasBinu</dc:creator>
      <dc:date>2013-07-22T05:19:35Z</dc:date>
    </item>
    <item>
      <title>Re: Callbacks for network analyst tasks</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/callbacks-for-network-analyst-tasks/m-p/584241#M3997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Aditya, whoops, missed your question. Hopefully my answer isn't too late. You want to check out AsyncTask.get() &lt;/SPAN&gt;&lt;A href="http://developer.android.com/reference/android/os/AsyncTask.html#get%28long,%20java.util.concurrent.TimeUnit%29"&gt;http://developer.android.com/reference/android/os/AsyncTask.html#get%28long,%20java.util.concurrent.TimeUnit%29&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Andy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 20:38:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/callbacks-for-network-analyst-tasks/m-p/584241#M3997</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2013-07-22T20:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Callbacks for network analyst tasks</title>
      <link>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/callbacks-for-network-analyst-tasks/m-p/584242#M3998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thomas, good point, thanks. Yes, I agree that for some common use cases that pattern could significantly simplify things. I recommend you either submit an enhancement request at &lt;/SPAN&gt;&lt;A href="http://support.esri.com/en/"&gt;http://support.esri.com/en/&lt;/A&gt;&lt;SPAN&gt;, and/or post it to &lt;/SPAN&gt;&lt;A href="http://ideas.arcgis.com/"&gt;http://ideas.arcgis.com/&lt;/A&gt;&lt;SPAN&gt;. Both of those are monitored for good ideas, and they provide a mechanism for officially tracking them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Andy&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Jul 2013 20:44:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-runtime-sdk-for-android-questions/callbacks-for-network-analyst-tasks/m-p/584242#M3998</guid>
      <dc:creator>AndyGup</dc:creator>
      <dc:date>2013-07-22T20:44:01Z</dc:date>
    </item>
  </channel>
</rss>

