Should everything related to maps or locations in an android app be handled through AsyncTask or a Separate Thread? What are the problems if I don’t use AsyncTask (or background threads) to access the current location of a person and mark it on the map or even take different latitude/longitudes from a database and mark it on the map?
Could you please give some examples of situations (particularly related to maps and locations) where AsyncTask is used?
Thanks
An asyncTask is a different/background thread. Its an easy way to use one.
If you are showing a location on a map you don’t need to handle it in a different thread.
You simply call this method
However if you are pulling co-ordinates from a database then you would need a background thread to access the database and alter the data into the required state.
Anything task that takes even the slightest amount of time and its not accessing the UI should be done in the background. Here is a nice resource. http://android-developers.blogspot.de/2010/07/multithreading-for-performance.html
There are some examples there