Callbacks for network analyst tasks

Discussion created by susanmtw on Jun 7, 2013
Latest reply on Jul 22, 2013 by agup-esristaff
Hi ,

I am new to Esri android developer scene. I have prior experience with the  Arcgis sdk for javascript and silverlight. I was trying to get  a basic routing application running on my device. For other Arcgis  APIs,  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.

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?